Creating a downloadable product in PrestaShop 1.6.x is very similar to creating a standard product with the exception of uploading files that you intend to sell.
Unfortunately, if your files are too large, you will get the error “file “your filename” is missing, server filename: some alpha numeric string”. Luckily for us, this is a common error and it’s an error that can easily be fixed.
In the video below I show you how to fix this error:
Can’t view the video? Watch it on YouTube
Creating a downloadable product:
To start, simply go to your admin panel and select “catalog” and “products” from the left column and then click on “add new product” from the top of the page to list a new product.
For “type”, select “virtual product (services, booking, downloadable products, etc.)” and file out the rest of the form as you would an other type of product.
Then go to the “virtual product” section and select “yes” for “does this product have an associated file?”.
Then click on “add file” to upload your file.
For number of downloads allowed, simply enter “0” for unlimited or enter the numeric value that you want to allow.
For “expiration date”, leave the input box empty if you’d like the file to be available for download indefinitely or click on the input box and select the date that you would like the file to expire on.
For “number of days” simply enter 0 for unlimited access or enter a number if you’d like the file to only be available for download during a specific period of time.
Diagnosing errors:
If you’ve received the error “file “your filename” is missing, server filename: some alpha numeric string”, save your product and launch your FTP client or file manager and open edit the file “Uploader.php” in the “classes” directory.
Then edit the line:
const DEFAULT_MAX_SIZE = 10485760;
which is located in the “UploaderCore” class.
You basically want to edit “10485760” which is in bytes and equal to 10MB to whatever size you need PrestaShop to be capable of supporting.
So for example if the largest file that you plan on uploading is 20MB in size, you would just multiply “10485760” by 2 and replace the value with “20971520”.
Note that you may also need to edit your php.ini or php5.ini file with the following values:
upload_max_filesize = 20M post_max_size = 20M
Just replace “20M” with the size that you need to upload.
Then simply go back to your admin panel and select “catalog” and “products”, then edit your downloadable product and upload your file again. If all the edits were successful, your file should have uploaded successfully at this point.