开发者

Blank Response when downloading large files from S3 with Zend Framework

I am using the Zend Frameworks Zend_Service_Amazon_S3 class to download files from the Amazon S3 server within a codeigniter application.

My script first checks the user is authorised to download the file, then attempts to force download it from the S3 servers. I have it working when the download file is a small test zip (661 bytes), but when I try and download one of the large video zips (150 MB+) I just get a blank screen.

The code is as follows:

$this->load->helper('download');

$s3 = new Zend_Service_Amazon_S3();

force_download($video->filename(), $s3->getObject($video->s3_object_path()));

Where $video is an instance of a model i have representing the vide开发者_Go百科os.

Size seems to be the issue here, that is the only difference i see between the two files.

Ideally I would like the data from S3 to bypass the server the application is hosted on. The force_download function in codeigniter sets the "Content-Disposition: attachment;" header. From reading other related posts on here, this should bypass the server right?


You should turn on error reporting and see what the actual error is, or check your error logs. My guess is that the script may be timing out due to the large file. Try adding set_time_limit(0); right before the call to force_download().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜