felonia Posted December 4, 2014 Share Posted December 4, 2014 We want to offer video files for download in our shop (PS 1.5.4.1). We already have MP3 files and this works fine. But with the video files we have the problem that the download is interrupted at around 180 MB. I checked the MP3 files and they are all smaller than the videos, so I think it's a problem of the file size. It cannot be a problem of the server as I moved the files out of the shop folder and then the download works fine. Is there something like a download size limit in PS? I couldn't find something like this and I don't know how I can solve this problem.Thanks for your support! Link to comment Share on other sites More sharing options...
Eolia Posted December 4, 2014 Share Posted December 4, 2014 Check in ../controller/GetFileController.php (about line-284) ,and try to increasing the fgets "maximum line length" value (default = 16384) echo fgets($fp, 16384); 1 Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 Thanks for that, but unfortunately it doesn't help :-( Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 So bad Could you set display_errors = "true" in /config/defines.inc.php and retry ? or look in the apache error.log Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 that's the latest entry from the logfile where I tried another download anon-94-216-237-224.vodafone-ip.de - - [05/Dec/2014:16:41:14 +0100] "GET /index.php?controller=get-file&key=fa65a8760b841f11f1586b3563e027a0cf5b976e-e3551c4924718caf499e9f22fe14e12c3f3b0901&id_order=121&secure_key=b299a9fb04ba0a362e8f830dabf48ec1 HTTP/1.1" 200 6447104 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0" can you see anything from that? Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 No problem it's the access.log Look in the error.log Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 oops, sorry :-) I think I don't have access to my server's error log I tried it with the defines.inc.php but it doesn't show anything, just download and interrupt Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) ah, finally I found them :-) but the latest entry is from 16:20 and my latest download from around 16:45), is there something missing? But I can see there's a fatal error in the first line... 05.12.2014 10:17:07 xyz.de [client 94.216.109.0] PHP Fatal error: Maximum execution time of 0 seconds exceeded in /mnt/web2/c0/18/52442018/htdocs/store/controllers/front/GetFileController.php on line 28005.12.2014 10:34:45 xyz.de [client 94.216.109.0] PHP Warning: Missing argument 2 for ToolsCore::displayDate(), called in /mnt/web2/c0/18/52442018/htdocs/store/modules/mailalerts/mailalerts.php on line 261 and defined in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 613, referer: http://xyz.de/index.php?controller=order-opc05.12.2014 10:35:14 xyz.de [client 94.216.109.0] PHP Warning: Cannot modify header information - headers already sent by (output started at /mnt/web2/c0/18/52442018/htdocs/store/classes/order/OrderHistory.php:1) in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 141, referer: http://xyz.de/Backoffice/index.php?controller=AdminOrders&id_order=119&vieworder&token=a3c35d471332a1e5fa1b824482a4d0aa05.12.2014 16:01:12 xyz.de [client 94.216.109.0] PHP Warning: Missing argument 2 for ToolsCore::displayDate(), called in /mnt/web2/c0/18/52442018/htdocs/store/modules/mailalerts/mailalerts.php on line 261 and defined in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 613, referer: http://xyz.de/index.php?controller=order-opc05.12.2014 16:01:40 xyz.de [client 94.216.109.0] PHP Warning: Cannot modify header information - headers already sent by (output started at /mnt/web2/c0/18/52442018/htdocs/store/classes/order/OrderHistory.php:1) in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 141, referer: http://xyz.de/Backoffice/index.php?controller=AdminOrders&id_order=120&vieworder&token=a3c35d471332a1e5fa1b824482a4d0aa05.12.2014 16:19:51 xyz.de [client 94.216.109.0] PHP Warning: Missing argument 2 for ToolsCore::displayDate(), called in /mnt/web2/c0/18/52442018/htdocs/store/modules/mailalerts/mailalerts.php on line 261 and defined in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 613, referer: http://xyz.de/index.php?controller=order-opc05.12.2014 16:20:10 xyz.de [client 94.216.109.0] PHP Warning: Cannot modify header information - headers already sent by (output started at /mnt/web2/c0/18/52442018/htdocs/store/classes/order/OrderHistory.php:1) in /mnt/web2/c0/18/52442018/htdocs/store/classes/Tools.php on line 141, referer: http://xyz.de/Backoffice/index.php?controller=AdminOrders&id_order=121&vieworder&token=a3c35d471332a1e5fa1b824482a4d0aa Edited December 5, 2014 by felonia (see edit history) Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) there are two other earlier errors regarding download 05.12.2014 10:17:07 xyz.de [client 94.216.109.0] PHP Warning: filesize(): stat failed for /mnt/web2/c0/18/52442018/htdocs/store/download/9427fbab32177382c0e8dfe4c48665bf6a419232 in /mnt/web2/c0/18/52442018/htdocs/store/controllers/front/GetFileController.php on line 27605.12.2014 10:17:07 xyz.de [client 94.216.109.0] PHP Warning: fopen(/mnt/web2/c0/18/52442018/htdocs/store/download/9427fbab32177382c0e8dfe4c48665bf6a419232): failed to open stream: Value too large for defined data type in /mnt/web2/c0/18/52442018/htdocs/store/controllers/front/GetFileController.php on line 279 that's in my getfilecontroller.php: /* Set headers for download */ header('Content-Transfer-Encoding: binary'); header('Content-Type: '.$mimeType); header('Content-Length: '.filesize($file)); header('Content-Disposition: attachment; filename="'.$filename.'"'); ob_end_flush(); $fp = fopen($file, 'rb'); while (!feof($fp)) echo fgets($fp, 16384); exit; } Edited December 5, 2014 by felonia (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 Yes, it's a 32bit limitation of php for the fopen() function. Your php must be re-compiled but you can't... Try this: Replace in the getfileController while (!feof($fp)) echo fgets($fp, 16384); by this: fpassthru($fp); And tell me Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 nope, same problem it's like this now, correct? /* Set headers for download */ header('Content-Transfer-Encoding: binary'); header('Content-Type: '.$mimeType); header('Content-Length: '.filesize($file)); header('Content-Disposition: attachment; filename="'.$filename.'"'); ob_end_flush(); $fp = fopen($file, 'rb'); fpassthru($fp); exit; } Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 (edited) Yes. Another way: Replace ob_end_flush(); $fp = fopen($file, 'rb'); fpassthru($fp); exit; by ob_end_flush(); readfile($filename); exit; This is my last shot ... Edited December 5, 2014 by Eolia (see edit history) Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) now it downloads nothing at all :-( Edited December 5, 2014 by felonia (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 A last... replace readfile($filename); by file_get_contents écho ($ filename); After, I run out of ideas Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 écho like that? or echo without the accent? Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 écho like that? or echo without the accent? No, i've made a mistake, sorry in the previous post replace readfile($filename); by readfile($file); It should be done Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 nope I'm going mad with this... Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 but thanks a ton for your help, very much appreciated! do you know if there's a possibility to add the download manually sowewhere? if not I will cancel the automatic mails with the download link and send manual ones Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 Weird, I just tested and it works. Link to comment Share on other sites More sharing options...
Eolia Posted December 5, 2014 Share Posted December 5, 2014 but thanks a ton for your help, very much appreciated! do you know if there's a possibility to add the download manually sowewhere? if not I will cancel the automatic mails with the download link and send manual ones Yes, upload yours videos in a directory as your_shop/gifts/video1.zip And add a link in your confirm order mail as: You can download your gift video here: <a href="http://your_shop/gifts/video1.zip" > YOUR GIFT VIDEO</a> Link to comment Share on other sites More sharing options...
felonia Posted December 5, 2014 Author Share Posted December 5, 2014 seems that there's no other solution Link to comment Share on other sites More sharing options...
Recommended Posts