Search code examples
htmlamazon-web-servicesfile-uploadamazon-s3synology

Static site upload to S3 using DiskStation Cloud Sync causes download response instead of page serve


I have a static website with 7844 pages on 1 topic (schools in Holland). This is based on 7844 named folders with 7844 index.html files, total size 209 MB. E.g. this is a published page.

The manual upload to my AWS S3 bucket (management console, select bucket, select folder, select upload, drag and drop) is very slow, it sometimes takes 12 hours to upload a new version of all pages.

I therefore wanted my Synology DiskStation to do the upload in the background. Using the DiskStation "Cloud Sync" tool.

The upload runs but the result is strange: the uploaded page is no longer served as webpage by S3 but instead triggers a download of the index.html files. E.g. this page that was uploaded by DiskStation Cloud Sync.

Hoping for an explanation of this behavior and advise on the best solution to do the upload in an easy way... (I am looking into using boto on python now).


Solution

  • FYI Synology tech support has analysed the logfiles and confirms that this is an issue with the software. I.e. Cloud Sync 'isn't setting the correct mime types for a static website' as Mark suggested. -> The issue is that the mime type on set by Cloud Sync is "document". It would need to be "text/html" for the browser to view it as a website.

    Synology Technical Support recorded the issue and states that their developers are working on it and hope to fix it in future Cloud Sync package update.