Home > Technical & Creative Skills > Programming, Servers & Scripts

Amazon S3 Cloudfront issue (11)


09-02-2017 08:40 AM #1 bachroll (Member)
Amazon S3 Cloudfront issue

Hello. I'm using Amazon S3 and Cloudfront as my hosting service for my website and also to host my landing pages. Until now everything worked fine. I create folders for each landing page and inside there is an index.html file. The URL would be something like this for the landing pages:

http://www.mywebsite.com/LP1/index.html

For some reason, since yesterday when I upload a landing page and type the URL, it tries to download the index.html file. I tried this on several browsers and the only one that show the web page normally is Internet Explorer. All the other browsers try to download the index file. I’ve already opened a ticket on the Amazon support centre, but they haven’t answered yet.

In the meantime I have been trying different setups, mainly changing the metadata values (Content-type, Content-Disposition, etc.) but haven’t found the solution. Has anybody gone through this issue? Thanks in advance.


09-02-2017 09:28 AM #2 bachroll (Member)

I think I know whats the problem. The index should have the metadata Content-type: text/html. For some reason that option doesn't exist on the index.html of the landing pages inside their folders. The funny thing is that it use to work perfectly. Now by default Content-type is binary/octet-stream. There are other options but the text/html is missing.


09-02-2017 09:43 AM #3 bachroll (Member)

Ok, now it's working. I deleted the Content-type binary/octet-stream and created a new one on each index.html page using text/html. That was the problem. I still don't know why this happened though.


09-03-2017 10:03 AM #4 Mr_TN (Member)

Quote Originally Posted by bachroll View Post
Ok, now it's working. I deleted the Content-type binary/octet-stream and created a new one on each index.html page using text/html. That was the problem. I still don't know why this happened though.
How are you uploading your files? I think S3 Browser will automatically set the correct MIME type for your files otherwise amazon will set them by default to binary/octet-stream.

http://s3browser.com/features-conten...es-editor.aspx


09-03-2017 01:55 PM #5 bachroll (Member)

I do it using the FTP service that comes with the hosting. It use to set it correctly but something changed. I still don't now what it is.


09-03-2017 07:46 PM #6 johnnyx (Member)

I've the same problem at AWS. I'll setup test tomorrow and use you technique. Thanks B.


09-04-2017 09:51 AM #7 caurmen (Administrator)

@bachroll - so just to confirm, you're using the "Upload" function pictured there in the S3 browser?

That's weird if so. I've heard of this issue before but only when uploading from the command line.

Let me know and I'll investigate further. May well just be that someone at Amazon "moved fast and broke something" for a day or so.


09-04-2017 12:31 PM #8 johnnyx (Member)

Hello Bachroll,

Where did you set text/html?


===========================

In https://s3.console.aws.amazon.com
I only found these options in Change metadata
text/plain
text/rtf

In my test;
http://redtest.site.s3-website-us-east-1.amazonaws.com/

folder001
kept default

folder002
used text/plain

folder003
pointed to folder


09-04-2017 12:36 PM #9 johnnyx (Member)

Test followup;

deleted index.html in folder002
uploaded it again and boom;

Automatically it is set to text/html by AWS

Strange, anyone has any idea what happened?


09-05-2017 08:12 AM #10 bachroll (Member)

Quote Originally Posted by caurmen View Post
@bachroll - so just to confirm, you're using the "Upload" function pictured there in the S3 browser?

That's weird if so. I've heard of this issue before but only when uploading from the command line.

Let me know and I'll investigate further. May well just be that someone at Amazon "moved fast and broke something" for a day or so.
Yes, thats the issue. It happens when I use the "Upload" button on the S3 browser. It still happens but I can fix it using the method described above. Maybe Amazon changed something, I dont know.


Quote Originally Posted by johnnyx View Post
Test followup;

deleted index.html in folder002
uploaded it again and boom;

Automatically it is set to text/html by AWS

Strange, anyone has any idea what happened?
That's strange. I still can't make it work that way. I'll keep testing though. Maybe Amazon was doing some kind of maintenance and it will start working normally again. Any way, answering to you former question, I change that value double clicking on the index.html and deleting the Content-type binary/octet-stream. Than I add a new one with the text/html value. This is the section where I did it


09-09-2017 03:18 PM #11 johnnyx (Member)

Another follow up;

New test and it works now like it should;
upload html-file = automatically => metadata=text/html

I guess it was a AWS-bug at the time of this thread (AWS had just changed the interface)


Home > Technical & Creative Skills > Programming, Servers & Scripts