azure-function-express icon indicating copy to clipboard operation
azure-function-express copied to clipboard

fix : 2.0 seems to have broken static file serving on azure. #21

Open kfhak-zb opened this issue 6 years ago • 1 comments

for raw file data download and send

like below if "encoding" value set to "binary" then not doing body.toString() in convertToBody function

app.get("/api/getfile", function (req, res) {

const data = fs.readFileSync("sample.pdf");

res.writeHead(200, {

	"Content-Type": "application/pdf",

	"Content-Disposition": "attachment;filename=output.pdf"

});

res.end(data, "binary");

});

kfhak-zb avatar Feb 20 '19 08:02 kfhak-zb

Codecov Report

Merging #30 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #30   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines          67     67           
  Branches       18     18           
=====================================
  Hits           67     67
Impacted Files Coverage Δ
src/OutgoingMessage.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2bd9041...7860bc5. Read the comment docs.

codecov-io avatar Mar 07 '19 06:03 codecov-io