I have a page with javascript that is working localy using ‘theme serve’ but not on shopify server.
The url is computed dynamically by shopify, something like '“https://cdn.shopify.com/s/files/1/0592/8421/4512/t/1/assets/42a0ee4e462cc7ac412522343.zip”
Locally, the file is correctly loaded using a fetch, and can be downloaded directly from the browser using the provided link.
On the shopify server, the fetch is not working. When I try a direct download from the browser, it returns a 1ko file (instead of ~100ko) with the correct name.
It seems Shopify does not allow complete download of binary files. Is there a way to change that?
Hi @minichua , welcome to Shopify community.
I am surprised that “theme serve” does not show an error or a warning when trying to serve a ZIP file.
Shopify doesn’t allow to serve ZIP files.
The only files allowed are the following:
- JS
- CSS
- GIF
- JPG
- PNG
- JSON
- CSV
- PDF
1 Like
Hi @drakedev ,
Good to know.
Are you referring to this documentation article:
https://help.shopify.com/en/manual/shopify-admin/productivity-tools/file-uploads
It is mentionned that there is a file restriction for the trial plans (which I use) to upload files but not for paid plans. It is the same for file serve?
On the file type listed, the restriction it is related only to PDF files. You can upload PDF of maximum size of 20MB.
ZIP files cannot be served directly by Shopify on any plans, not even on Shopify Plus.
There are specific apps that allow to serve ZIP files, used in store that offers Digital Downloads, etc. but the way in which the files are stored and served is different.
You can check for specific apps or host the ZIP files in an external cloud service.
1 Like