Amazzing Posted December 4, 2013 Share Posted December 4, 2013 Hello, I can't figure out, what is 'download' folder used for. I have several shops. In some of them it is empty (containing only .htaccess and index.php) and on one of them it has lots of files with unknown extension. Some of these files are about 3MB. What are they used for and is it safe to delete them? Thanks Link to comment Share on other sites More sharing options...
vekia Posted December 4, 2013 Share Posted December 4, 2013 if you attach files to your products - they are stored there (as a hash) Link to comment Share on other sites More sharing options...
bellini13 Posted December 5, 2013 Share Posted December 5, 2013 If you have virtual products, the files that the customer would download is stored there. Link to comment Share on other sites More sharing options...
Amazzing Posted December 9, 2013 Author Share Posted December 9, 2013 Thanks for the answers, vekia and bellini13 I have one more question. Most of my files in 'download' folder are actually pdfs. So, when I try to open any of these files, they are 'saved as'. This is the link I use to access a particular file: ../index.php?controller=attachment&id_attachment=xx My question is: is it possible to open PDFs in browser instead of directly downloading them? It is probably related to Content-Disposition header, but I am not sure how to deal with files, stored as a hash Link to comment Share on other sites More sharing options...
bellini13 Posted December 9, 2013 Share Posted December 9, 2013 you would have to alter the GetFileController, and using the filename (which would include .pdf), you would set the mime type and headers appropriately. You should google that topic for understanding how to force the adobe reader to open, instead of prompting the user to save the file as Link to comment Share on other sites More sharing options...
Amazzing Posted December 10, 2013 Author Share Posted December 10, 2013 (edited) Thanks for advising to look in controllers, however in this case we don't need the GetFileController, but we need the AttachmentController.php. Here is how I managed to display PDF attachments in browser: replace this: header('Content-Disposition: attachment; filename="'.utf8_decode($a->file_name).'"'); by this: if ($a->mime == 'application/pdf'){ header('Content-Disposition: inline; filename="'.utf8_decode($a->file_name).'"'); } else { header('Content-Disposition: attachment; filename="'.utf8_decode($a->file_name).'"'); } In this case only PDFs are opened in browser. All other files are downloaded as regular attachments. Edited December 13, 2013 by Amazzing (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now