Jump to content

Placing large virtual products in another folder and file names


Recommended Posts

I have a lot of problems regarding vitual products because I frequently update the files for each product and the file name (hash) in the download folder doesn't helps, also I must use a special module to upload my files and assign it to a product because they are very large files.


My intention is to put the files to be downloaded in another folder and with their original names, then I create a very small file ( may be a text file) and rename it with the same file name and extension and using original prestashop virtual product tab upload it and assign it to the product, this will create a record for the download with the correct file name and a new hash-named-file in the download path ( this file will never be used). No problem by using large files because the large file is not used to set the relation, only a small "fake" file.


At GetFileController.php just after setting the mime Type, the filename ( without path) is available from the database and I can change the origin folder to my own overwriting the hash-named-file:


$file = "/home/myserver/public_html/myfolder/".$filename;


this way my own file will be downloaded instead the hash-named-file in the download folder


Do you see any problem I must be aware with this change?


Actually it would be possible to change the process for uploading the fake file and only set the file name for the product.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...