Yii 1.1: edownloadhelper

Download a file with resume, stream and speed options
15 followers

This extension is a helper for file downloads with resume, download speed and stream options.

**Tested only on Apache with DownthemAll FireFox plugin.

IMPORTANTAll helper extensions have been now moved to a more significant repository. Get the most up to date versions from it.

ChangeLog

  • 2011-01-29 Fixed "ob_flush(): failed to flush buffer. No buffer to flush." ( Rangel Reale)
  • 2011-01-25 Bugs Fixed -headers were not correctly printed

Requirements

Developed with Yii version 1.1.6

Usage

Download and extract the extension on your protected/extensions folder. The extension will be under a folder named 'helpers'.

The extension just have one static method and static property array that holds file extensions to be streamed. It use is quite straightforward:

NOTE: On the comments within the extension there is a DS reference that is a shortcut to DIRECTORY_SEPARATOR. Please, use as the following below:

// Import library ( assuming in protected.extensions.helpers)
Yii::import('ext.helpers.EDownloadHelper');
 
// assumming I have a folder named docs under my webroot folder
// and a file to be downloaded 'myhugefile.zip'
EDownloadHelper::download(Yii::getPathOfAlias('webroot.docs').DIRECTORY_SEPARATOR.'myhugefile.zip');

Resources

Total 4 comments

#16930 report it
malkabani.com at 2014/04/14 07:25am
chrome not suported

after try to download for first time it download but when try to download agen it dosn't work.

#14388 report it
arun vivek at 2013/08/08 01:23am
its working

download the zip file

unzip it

place the 'helpers' folder under ur_app/protected/extensions

Yii::import('ext.helpers.EDownloadHelper'); EDownloadHelper::download(Yii::getPathOfAlias('webroot.docs').DIRECTORY_SEPARATOR.'myhugefile.zip');

place the above the code on your controller action....

'docs' is the folder under protected where your files are stored

'myhugefile.zip' is the file name which is to be download

#12932 report it
Andre Lopez at 2013/04/21 04:34pm
Thanks!

Excelent Work!!

#2933 report it
Trejder at 2011/02/26 08:55am
We need (want) more info! :]

Antonio, no it is NOT quite straightforward to use! :] Please, provide more information. In my humble opinion, you missed installation part with usage - what you wrote about usage is actually an installation chapter, and for true usage you wrote nearly nothing! :]

Provide some examples on how use this extension on both, client side (browser with plugin) and server side (Yii code), please, please, please! :]

Leave a comment

Please to leave your comment.

Create extension