Jump to content

Virtual product download is interrupted


Recommended Posts

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

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

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 280
05.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-opc
05.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=a3c35d471332a1e5fa1b824482a4d0aa
05.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-opc
05.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=a3c35d471332a1e5fa1b824482a4d0aa
05.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-opc
05.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 by felonia (see edit history)
Link to comment
Share on other sites

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 276
05.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 by felonia (see edit history)
Link to comment
Share on other sites

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

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

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

×
×
  • Create New...