Greetings. I’ve had our GRAV site in production for a few months now and am extremely pleased with it.
We’ve been hosting PDFs there for some time without issue. Yesterday I posted a ZIP file for the first time. When it is downloaded, users are getting a message indicating that the ZIP file is corrupted.
I’ve copied the same ZIP file to another host and downloaded it from there without issue. So it is not the ZIP file. In fact every zip file we put there returns the same error.
We’re running our own custom theme which inherits the standard antimatter theme. (I’ve read elsewhere in this forum that this might be the issue.) We’re running under NGINX at DigitalOcean.
Assuming you’re just linking to a zip file sitting on the file system, I see no reason why Grav would be a part of the problem. A quick search of the source code only shows zip even being mentioned in the command-line backup-restore functions. Smells like a server issue to me.
@Perlkönig @edwarr You forget that the zip is delivered by the
download method of Grav (https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Utils.php#L233-L323 ). So, most likely there is an issue there.
You can test it. If you know the real path of the zip file starting from the Grav root and request it by the browser, then the zip gets downloaded via the server. However, if you download the zip via the page, Grav handles the download. If the first one fails, then you have a server issue. If the second one fails, then there is most likely a bug.
@sommerregen … My apologies for the tardy reply! Thanks much for your comments.
I used the “real” URL like you suggested and it works just fine. No problems at all. That rules out NGINX as being the problem. (And thank you for that tip because I can use that as the work-around for the client now.)
Meanwhile it would seem that there’s a problem with the Grav download function then.
yes, it sounds like a bug in the
download function of Grav (maybe double encoding, wrong content length etc.). It is worth to file an issue at the Grav issue tracker with as much details as you can give including a reference to this thread.
Nice you have a workaround at hand, till this bug is fixed.
All the best,