Force S3 PDF to be viewed in browser instead of download

前端 未结 4 1110
说谎
说谎 2021-02-09 00:24

So you can force a download by using Content-Disposition: attachment

Content-Disposition: inline is the default and should display in the brows

4条回答
  •  忘了有多久
    2021-02-09 01:04

    You have to set your putObject params as follows to view pdf instead of download.

     params = {
            Bucket: process.env.S3_BUCKET,
            Key: ,
            Body: ,
            ContentDisposition:"inline",
            ContentType:"application/pdf"
        };
    

提交回复
热议问题