Amazon S3 downloads index.html instead of serving

后端 未结 5 1234
感情败类
感情败类 2020-12-05 12:35

I\'ve set up Amazon S3 to serve my static site, speakeasylinguistics.com. All of the DNS stuff seems to be working okay, because dig +recurse +trace www.s

5条回答
  •  半阙折子戏
    2020-12-05 13:28

    If you are doing this programmatically you can set the ContentType and/or ContentDisposition params in your upload.

    [PHP Example]

          $output = $s3->putObject(array(
              'Bucket' => $bucket,
              'Key' => md5($share). '.html',
              'ContentType' => 'text/html',
              'Body' => $share,
          ));
    

    putObject Docs

提交回复
热议问题