Home > Net >  Loading AWS S3 files on website suddenly shows raw code
Loading AWS S3 files on website suddenly shows raw code

Time:07-05

We're hosting files through AWS S3. Using a website we load those files (encrypted) and it's been working fine for weeks. Now suddenly we get this raw code when opening these files (for now only MP4s, PDFs, PNGs).

This morning I've enabled versioning on the bucket, but I don't think that would have caused it, or could it? I've looked up the specific file in the AWS bucket, and it was still available and working fine (can download open it). Also no other versions are there and its still in normal storage.

I've disabled versioning to be sure, but I guess it could take a while to take affect.

At first I thought it might be the code that's loading the files, but when I load the URL directly in the browser I get the same.

enter image description here

enter image description here

CodePudding user response:

Fixed. The Content-Type id was changed on the server. It was apparently updated and the original code didn't use get_headers(...,true) to get the Content-Type, but instead used the id.

  • Related