Any chance of support for uploaded txt, html files?

I`m using file force download for a list of documents, it works perfect for all the files execpt for files that the browser can read as default like txt, html,..

Thanks
Tim VS

Comments

arski’s picture

Title: No txt,html,... support » Support text/html files
Category: bug » support
Status: Needs review » Active

Hi, first of all, the status "needs review" is for when you upload a patch and need others to review it.

Other than that, I just tested it on my site, and the force download works perfectly for .txt and .html files as well. I'm guessing that your browser is simply ignoring the HTTP headers for those file types, especially if you say it works for other file types. (Although maybe it's a coincidence that it works for others..)

Can you post an URL to a jpg file where the force download works, and an URL to the txt file where it doesn't work (you can hide the domain name, not interested in that). Both those links should be going through the private file system (i.e. have something like system/files and NOT sites/all/files..) and the download=1 parameter at the end.

Cheers

lee20’s picture

I have this same issue, the URL for the file is not using the "system/files" path but has the download=1 parameter at the end.

Does the file field need to be set to use the private file system?

arski’s picture

Status: Active » Closed (works as designed)

yes, it's as simple as this: if the URL says "sites/all/../files/myfile.jpg" then the web server will directly fetch the file without ever touching any Drupal bits. So there is simply nothing any module will be able to do with such links (apart from doing some hacking around with the server setup.. which we'll never be doing).

So short answer: yes, you need private file system enabled for the module to work (it's pretty clearly stated in the README).

Closing for lack of followup from OP.

lee20’s picture

So short answer: yes, you need private file system enabled for the module to work (it's pretty clearly stated in the README).

My question wasn't whether or not the private file system needed to be enabled but more specifically:

Must the file (or image) FIELD be configured to save to the private file system?

arski’s picture

isn't that the same really? yes, your files need to go through the private file system (field-specific setting or global..) if you want to use file force.