Jump to content

[SOLVED] Issue with Prestashop 1.3.1 and Downloadable Products


Recommended Posts

Hey Guys

So I was using Prestashop 1.2.5 to develop a site and everything was working great, including downloading products in all browsers.

When I upgraded to 1.3.1 , my digital product downloads would work fine in safari, but not in firefox or chrome. I would get a page not found error.

After digging around in get-file.php i figured out that what was causing that to happen was including include(dirname(__FILE__).'/init.php');

ini.php...

looking around in init.php i found that turning on output buffering in there ob_start(); was causing the download not to launch

discarding the buffer directly below the include in get-file.php , i.e. the code below solved that and now my product downloads launch again, but my question is, what's changed since 1.2.5 to cause this behaviour. or do I have something screwed on my server? or is it a bug...


New Code top of get-file.php:


include(dirname(__FILE__).'/init.php');
ob_end_clean();

Link to comment
Share on other sites

Ok

So re that whole readfile thing , I can't deal with the server running out of memory , script timeouts etc, so I rejigged the get-file.php file using some os-commerce code so that if you're on a linux , unix system you can take advantage of symlinks ...

feel free to use if you want...


File : settings.inc.php

define('DOWNLOAD_BY_REDIRECT', 'true');
define('_PS_TEMP_DOWNLOAD_DIR_', 'full file path to a temp download directory modded 777 here');
define('_PS_TEMP_DOWNLOAD_DIR_URL', 'full url to temp download directory modded 777 here');

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
then get-file.php (attached here)


Hi!... I was having problems with larger files over 10 MB in my prestashop store. I used the php file you put and now I could upload a file of 70 MB!, that's great!

I'm wondering if it'll be any kind of limit in the size file I can upload and then download without having problems... what fo you think. I'm thinking in files between 250 MB and 500 MB as much.

wait for your answer!

thanks!

Note: It's important to say that I'm using a module named batchdownloadableproduct, anyone who need it can buy it here: http://www.presto-changeo.com/lang-es/prestashop-modules/38-batch-downloadable-product.html
Link to comment
Share on other sites

Hey Man...if your downloads are working properly, size shoudln't be a problem I dont think....That method of redirecting above works on symlinking a file on a *nix box, not via outputting the file through the buffer...So you don't get memory_limit or script execution time issues, or you shouldn't.

This only works properly on *nix systems due to the symlinking though. On a windows host it would go back to the old way of doing things...


Best
Jon

Link to comment
Share on other sites

  • 1 month later...

Hello!

This doesnt work for me, i have problem with the path, i get a blank page when click at product to download, see path below: what is wrong?


define('DOWNLOAD_BY_REDIRECT', 'true');
define('_PS_TEMP_DOWNLOAD_DIR_', '/public_html/test1/download/');
define('_PS_TEMP_DOWNLOAD_DIR_URL', 'http://www.my-domain.com/public_html/test1/download/');

Link to comment
Share on other sites

software: batch-downloadable-product.html

bonjour, j’ai acheter le logiciel mais je comprend pas comment fonctionne les etapes. pouvez vous faire une demo ou bien faire des instructions etapes par etapes comment fontionne le logiciel. sa serais plus facile comme sa au lieu d’essayer a comprendre comment il fonctionne.une reponse en francais serais apprecié si possible.

merci !

hello, i have to buy the software but I do not include/understand how functions the step. can you make a demonstration or make instructions step by step how functions the software. its would be easier like its with the place; to test has to include/understand how it functions.

thanks !

Link to comment
Share on other sites

  • 2 weeks later...
Ok

So re that whole readfile thing , I can't deal with the server running out of memory , script timeouts etc, so I rejigged the get-file.php file using some os-commerce code so that if you're on a linux , unix system you can take advantage of symlinks ...

feel free to use if you want...


Thank you a thousand thank yous for sharing your modified code. It saved me countless hours and headaches trying to sort out the issue on a recent installation! Your generosity is very much appreciated!
Link to comment
Share on other sites

jon.mixnblend, thank you for your ingineous idea :). Works like a charm for big files (i.e 700MB) along with another great module from presto-changeo.com (http://www.presto-changeo.com/prestashop-modules/38-batch-downloadable-product.html)

Hello!

This doesnt work for me, i have problem with the path, i get a blank page when click at product to download, see path below: what is wrong?


define('DOWNLOAD_BY_REDIRECT', 'true');
define('_PS_TEMP_DOWNLOAD_DIR_', '/public_html/test1/download/');
define('_PS_TEMP_DOWNLOAD_DIR_URL', 'http://www.my-domain.com/public_html/test1/download/');



Max, you didn't defined correctly _PS_TEMP_DOWNLOAD_DIR_URL, you have to add http://www.my-domain.com/test1/download/.

Basically you need to strip out /public_html/ from that url.
Link to comment
Share on other sites

  • 4 weeks later...

The fast way to change your upload limit size in prestashop is to edit your .htaccess file from root with notepad by adding this :
# Max size upload file
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_execution_time 200
php_value max_input_time 200

save and upload :)

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

I've run into a spot of yet more bother with this whole digital downloads issue. All my products have been uploading fine. I had downloaded the get-file.php file that you uploaded and everything was working well. However, the last 6 of my products are now not downloading after I have uploaded them to the FTP. I get a Web Page Not Found error! This is extremely frustrating. These files aren't even anywhere near as big as some of the others I have uploaded and they are still downloading fine.

Does Prestashop have a total size limit for all files in the Downloads folder? I have increased my webspace as I was getting close to my limit and it hasn't made any difference. Any help anyone can give me would be greatly appreciated. I've been trying to figure this last bit of farce out for 2 days now!

Thanks,

Samantha

Link to comment
Share on other sites

I've run into a spot of yet more bother with this whole digital downloads issue. All my products have been uploading fine. I had downloaded the get-file.php file that you uploaded and everything was working well. However, the last 6 of my products are now not downloading after I have uploaded them to the FTP. I get a Web Page Not Found error! This is extremely frustrating. These files aren't even anywhere near as big as some of the others I have uploaded and they are still downloading fine.



For more information, the page I get says:

This web page is not found.

No web page was found for the web address: http://www.buymagazinearticles.co.uk/test/admin123/get-file-admin.php?file=b434f1e73f9c0d35da4c0cd208a8abf769829d55

More information on this error
Below is the original error message

Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.

Thanks,

Samantha
Link to comment
Share on other sites

  • 2 weeks later...

I am using Prestashop 1.3.3 and My main problem was described here http://goo.gl/6fKL6

I directly downloaded the get-file.php and loaded it into the root folder.
And when I use below code;

define('DOWNLOAD_BY_REDIRECT', 'true');
define('_PS_TEMP_DOWNLOAD_DIR', '/eshop2/download/');
define('_PS_TEMP_DOWNLOAD_DIR_URL','http://my-domain.com/eshop2/download/');

I get the error message as shown on the Page-1 when I try to download any file using browser.

If you analyse the Page-2; The path is showing (Page-1) here is not correct! The file is showing on th download folder! but it is on the root folder!

Please help me...

34984_RiE7Cjq2rVbTSFJ53LPv_t

Link to comment
Share on other sites

How should by paths look like?

This is how I have entered the paths.

define('DOWNLOAD_BY_REDIRECT', 'true');
define('public_html/download/', 'full file path to a temp download directory modded 777 here');
define('http://www.hd-fireplace.com/download/', 'full url to temp download directory modded 777 here');

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
Ok

So re that whole readfile thing , I can't deal with the server running out of memory , script timeouts etc, so I rejigged the get-file.php file using some os-commerce code so that if you're on a linux , unix system you can take advantage of symlinks ...

feel free to use if you want...


File : settings.inc.php
define('DOWNLOAD_BY_REDIRECT', 'true');
define('_PS_TEMP_DOWNLOAD_DIR_', 'full file path to a temp download directory modded 777 here');
define('_PS_TEMP_DOWNLOAD_DIR_URL', 'full url to temp download directory modded 777 here');



I have the same problem. I changed the get-file.php from the original one to the one made available here and nothing changed. But I am not sure what to do with the above code. I don't have (or can't find) the settings.inc.php file. Or do I just add the above code to another file? Or do I make the settings.inc.php file?

And also, where it says full file path...etc, do I do it like this http://www.mydomain.com/modded777 or like this /public_html/modded777?

I would be so grateful for any help or suggestions.

Many thanks,
Werner
Link to comment
Share on other sites

Hi, I probably have a diferent problem then. When I upload the file which is around 2mb it says that the file is not there. I probably have to make a folder for it to be uploaded in and set the permissions. I will have another look to see if I can figure it out.
Thanks

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...