I'm working on a 5.3 system using private downloads and today I broke all attachment downloads by replacing a PDF attachment directly under the /files directory in the hopes that it would allow users to start downloading the new file without modifying the node. I wasn't sure this would be ok (different file sizes, for example), but I figured the worst case would be that I could just return the original file and all would be fine.
But the result was pretty unexpected - now when I try to download any attachments through the node pages - not just the single file I messed with - I get the folowing 404 error in my browser:
===================
Not Found
The requested URL /system/files/ABCCaseStudy.pdf was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
===================
The file is most definitely still under the files directory. I checked the permissions and made sure all PDFs under the files directory have 664 permission. I did not change .htaccess at all. I've tried switching to public downloads but that gives the same 404 with the correct URL (without 'system').
This is a really scary way for me to break all file downloads on my test site (I'd be screwed if this happened on the prod site) and quite unexpected. Has anyone else seen this type of problem with all downloads? I'm not sure how to debug this or where to look for more research.
Comments
It was an .htaccess issue
I think i've tracked down the issue to my base .htaccess file, which had some logic to try to prevent hot-linking:
The only problem wias that that server URL had changed, so the HTTP_REFERER had the wrong URL to test against, and was therefor blocking all PDF and EXE files. Once I updated .htaccess the PDFs were downloading again without issue. Guess this was more a matter of testing methods than private download access.