Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Code Attachment Opens in Webpage
stevejwin
New
I have a forum in which we deal with a number of industry-specific platforms that use a lot of custom code files / extensions. They upload fine after adding them to config, but when attempting to download (you simply click on them) they open in a new webpage, displaying the code. I would just like for the attachment to be downloaded.
I searched, couldn't find a resolve for this. Has anyone else encountered this issue or can provide a solution? Many thanks!!
Tagged:
0
Comments
http://en.wikipedia.org/wiki/MIME
http://www.besthostratings.com/articles/mime-types-htaccess.html
grep is your friend.
If you zip the files they will download. Certain file types like tiff will download. And text files. If you want to avoid the files being opened in anew window, just zip them.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
It will work only for new attachments created.
here's a mod I tried that automatically zips txt files. which forces a zip download of the text.
worked for me.
it may work for you and someone may have improvements (for error checking zip and removing non-zipped version.)
it's more of a concept thing.
it does however produce a zip and a text file in your file uploads folder.
in FileUpload plugin
class.fileupload.plugin.php
from
however you could zip all txt files in your file uploads folder and change the extension in the media table to make old files work the same way.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Just wanted to say thank you for all of the replies....much appreciated!
hi! a lot of my users dont have winrar and unable to open the gz files...
i tryed to change it to "zip" axtention but i couldnt....
can somebody help me?
7-Zip, free and open source, should be able to open gz files:
http://www.7-zip.org/
yes sure...but for unknown reason the file is corrupted and i also think that asking all my users to install 7-zip is the same as asking them to zip their files
http://www.php.net/manual/en/zip.examples.php
grep is your friend.
You can also simply deny all uploads except zip, and images. therefore they have no choice.
grep is your friend.