jon.mixnblend Posted July 1, 2010 Share Posted July 1, 2010 Hey GuysSo 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 launchdiscarding 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 More sharing options...
jon.mixnblend Posted July 1, 2010 Author Share Posted July 1, 2010 Further, I see you guys are using readfile() to buffer the file to output? Surely this is going to cause issues with large downloads (multiple people downloading)? Script execution time, memory limit problems? Link to comment Share on other sites More sharing options...
jon.mixnblend Posted July 1, 2010 Author Share Posted July 1, 2010 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'); 1 Link to comment Share on other sites More sharing options...
jon.mixnblend Posted July 1, 2010 Author Share Posted July 1, 2010 then get-file.php (attached here) get-file.php Link to comment Share on other sites More sharing options...
chrisdyllan Posted August 4, 2010 Share Posted August 4, 2010 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 More sharing options...
jon.mixnblend Posted August 5, 2010 Author Share Posted August 5, 2010 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...BestJon Link to comment Share on other sites More sharing options...
Max_77 Posted September 15, 2010 Share Posted September 15, 2010 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 More sharing options...
Prestacasa Posted September 18, 2010 Share Posted September 18, 2010 software: batch-downloadable-product.htmlbonjour, 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 More sharing options...
aperio Posted September 27, 2010 Share Posted September 27, 2010 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 More sharing options...
Cornel Posted October 1, 2010 Share Posted October 1, 2010 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 More sharing options...
alex84 Posted October 29, 2010 Share Posted October 29, 2010 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 filephp_value upload_max_filesize 100Mphp_value post_max_size 100Mphp_value max_execution_time 200php_value max_input_time 200save and upload Link to comment Share on other sites More sharing options...
digtheweb Posted November 17, 2010 Share Posted November 17, 2010 Wow. I downloaded the get-file.php file that you uploaded and it works brilliantly. Thanks so much for this. I've been banging my head against a brick wall all day! You're a star! Link to comment Share on other sites More sharing options...
digtheweb Posted November 30, 2010 Share Posted November 30, 2010 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 More sharing options...
digtheweb Posted November 30, 2010 Share Posted November 30, 2010 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=b434f1e73f9c0d35da4c0cd208a8abf769829d55More information on this errorBelow is the original error messageError 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.Thanks,Samantha Link to comment Share on other sites More sharing options...
Asim Posted December 11, 2010 Share Posted December 11, 2010 I am using Prestashop 1.3.3 and My main problem was described here http://goo.gl/6fKL6I 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... Link to comment Share on other sites More sharing options...
need4speed Posted December 14, 2010 Share Posted December 14, 2010 Its because prestashop cant hande large files I have the same problem. Link to comment Share on other sites More sharing options...
need4speed Posted December 14, 2010 Share Posted December 14, 2010 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 More sharing options...
Cost Tamers Posted February 12, 2011 Share Posted February 12, 2011 Where do I put this this get-file.php or what do I do with it. Link to comment Share on other sites More sharing options...
Cost Tamers Posted February 12, 2011 Share Posted February 12, 2011 Didn't do a thing for me Link to comment Share on other sites More sharing options...
kawaiitrader Posted March 1, 2011 Share Posted March 1, 2011 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 More sharing options...
need4speed Posted March 2, 2011 Share Posted March 2, 2011 Im quite sure this has been fix in the official release after I had reported the bug. Because they said they had fixed it! Link to comment Share on other sites More sharing options...
kawaiitrader Posted March 2, 2011 Share Posted March 2, 2011 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 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