zubrag.com
Free php and cpanel scripts to automate your daily routine

Free PHP Scripts :: Smart File Download

Use Smart File Downloader to avoid direct files downloads (hide real file paths), and to limit downloads to only some set of file types.

Features:
  • customizable allowed file types for download
  • predefined mime type settings for following extensions: zip, pdf, doc, xls, ppt, exe, gif, png, jpg, mp3, wav, mpeg, mpg, mpe, mov, avi
  • Hotlinking protection
  • Script can log downloads in plain text file. Log file includes: IP, date/time, filename. Can turn this feature on/off.
  • automatic mime type detection (if Mimetype or Fileinfo extension installed on the server)

Usage:
  • Unzip script to some folder
  • Update download.php with your desired settings for base downloads folder, downloads log file name, allowed file types
  • Use following syntax for downloads: download.php?f=FileName

Sample download link:
<a href="http://path/to/script/download.php?f=phptutorial.zip">Cool PHP Tutorial</a>

Note:
Make sure you set write permissions on the folder where downloads log is saved if you turned downloads log feature on. Otherwise you may experience file access permissions issues (log file will not be created/updated).
All files for download must be placed in the download folder you specified in the script settings.

Download Smart File Download


Comments

Matt July 31, 2006
Works great! Thanks!
August 4, 2006
odd that you don't appear to use the script itself to distribute the download on this page...

zubrag: We don't use it on zubrag.com because we are not trying to avoid direct downloads, and for downloads tracking we use Google Analytics. Google Analytics will not track direct downloads, but it is not a big issue.
martyowens [anti-spam] gmail.com August 5, 2006
Nice. In the 7th header line, is the ; after ...filename=$fname;); an error?
I mean the ; inside the end ).
genzoeri [anti-spam] gmail.com August 5, 2006
Really,, nice job. Thanx zubrag, I am waiting for your other script.
Annoyed August 8, 2006
Too bad thee is no instructions on how to add the downlad links to the page. What I find on this page is quite vague!!!
August 9, 2006
Thanks for this script. Had used others in the past that produced errors but this one works fine. Danke :)
george.tyrakis [anti-spam] gmail.com August 10, 2006
Awesome script! 1 question though, is it possible to make this script display some html and then give the download? Please help as I have a project due in very soon!

zubrag: why don't show HTML first from your application, and from that HTML give the download link? For example you might have webpage "X" wich lists some products for download, and each product has link to the HTML page "Y" (the HTML page you want added to the downloader), which would contain actual download link. Such solution seems to be more flexible since you would have more control over it. Wouldn't that work?
him August 12, 2006
heh.. just right click -> open in new window and file's URL appears ;>

zubrag: that way you'll only get "download via this downloader" URL. It will not reveal the real file path, thus avoiding direct downloads.
Kaali August 13, 2006
Hello! I want to ask that is download.php should be in same directory as the files which are to be downloaded with this script.

Because this error is displaying:

File does not exist. Make sure you specified correct file name.

my download.php is located in
public_html/download/

& downloads are located in
public_html/download/downloads/

why the error is coming?

zubrag: you can place download.php where you want. Try putting absolute path (i.e. path from the root folder) in the BASE_DIR. In your case following relative path should also work: define('BASE_DIR','downloads/');
MrDude August 15, 2006
Great script but doesn't work with Internet Explorer 6+?

zubrag: strange, it works fine with my IE6 and Firefox. Could you provide more details?
agnesabert [anti-spam] yahoo.com August 17, 2006
i want U to posted it to me
blueberryjuice [anti-spam] gmail.com August 19, 2006
i'm using winXP, it is successful when download a zip file, but after download a pdf file the file seems corrupted, it cannot be opened with acrobat reader, any suggest? thx

zubrag: Cannot reproduce this problem. Can you provide more details? Your browser name, version? Maybe you are trying to download already broken file?
olloo August 23, 2006
cool
shoaibi September 3, 2006
Suppose if i want to add rmvb, rm, mkv, ogm, mp4, files to the allow file types, how should i do it?

zubrag: update allowed_ext array with your new allowed extensions, and its mime type.
For example here we are adding mp4:
// video
'mpeg' => 'video/mpeg',
'mp4' => 'video/mp4',
'mpg' => 'video/mpeg',
...
To determine mime type for some extension just google extension with "mime type". For example mp4 mime type. You can leave mime type empty if you cannot find correct mime type. In this case above block will look like:
// video
'mpeg' => 'video/mpeg',
'mp4' => '',
'mpg' => 'video/mpeg',
...
phoenix.suresh [anti-spam] gmail.com September 4, 2006
Hi zubrag,
This is really a great Script. Its full filling all my needs. But I have a few problem. where as my filename has space inbetween it.

For example:
file name.jpg

so when I click the link im getting "File does not exist. Make sure you specified correct file name." Error can you please help me to fix this problem.
Great thanks,
M. Suresh
nixforge [anti-spam] yahoo.com September 5, 2006
Hi all
how if want to download from another site >
moviespot [anti-spam] as.ro September 9, 2006
I'm trying to use your code in moviespot.as.ro/download.htm. It works for 2 small files but not with a 750KB file (first on page). Is there any way to "bypass" the server?
mailme420 [anti-spam] gmail.com September 12, 2006
my file is located in another server which don't support php. from my site server which support php but there not enough space. how can i use this script, if i want to give user to download a file from file server without seeing file server url & with web site server url?
maznos [anti-spam] gmail.com October 4, 2006
is it possible to integrate it to VBulliten
jake [anti-spam] capcoa.org October 18, 2006
I can't get the log file to work. I have both the folder and log file itself chmodded. I even tried to let it create one on its own and it didn't. Suggestions?
jake [anti-spam] capcoa.org October 18, 2006
I got the log working. I'm not sure you coded it to look for the downloads.log in the $base_dir. It was trying to find the file in the current directory it was at. I had to point it to the $base_dir where my downloads are kept.

just a thought.
x [anti-spam] homemadebyx.com October 30, 2006
Nice Script! A solution to this isn't vital, but if the file being downloaded has spaces in the filename, the script replaces spaces with underscores. Is there a way to maintain spaces?
Anton December 2, 2006
how could i do that

1. i have the folder set to /path/to/folder/ but i have sub folders like:

/path/to/folder/1
/path/to/folder/2
etc
where my files are located

2. i want to name the filename diffrent then what it is in the folder, example.

i have filename in there called:
testfile.mp3 but i want to called it when the user saves it as myfile.mp3

so i can get these settings from a DB.
Jay Edgar December 6, 2006
Great script - this is exactly what I needed for the seed of my secured download system. Thanks much for creating it!

Jay
December 12, 2006
Thanks for the time spent on this code.

something strange is happening. this code is working well with firefox but whilst using IE7 the browser displays the text in the file, those funny characters that appear when trying to open an audio file using notepad; no download is taking place. What could be the problem?
December 12, 2006
just found out the solution to my problem i highlighted above.

i added:
header("Content-Type: application/octet-stream");

to the headers.

Thanks for the code once again.

William
erik December 22, 2006
Great script! However I too cannot get the logs function to work. Folders are all set to be writeable, but no information is added to the log file itself.
gene kamote January 3, 2007
hey zubrag thanks alot for the codes..
January 7, 2007
Hi,

This is the error I'm encounting at the moment. Any chance of explaining what is happening?

Currently running on a Linux Machine. Trying to download file from IE 6
Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/Resource/IST07/) is not within the allowed path(s): (/home/teaching/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/teaching/public_html/Junior/downloaddata.php on line 83
jorgemajjul [anti-spam] msn.com January 12, 2007
Hi I'm looking for a script like www.driverguide.com, because I have a lot of drivers file to share in my server.

Please let me know if this is possible with Smart File Download

Thanks a Lot
serkan [anti-spam] kariahouses.net January 16, 2007
Hi,

The script is very usefull, but for pdf files, you can download only up to 1,9 MB and the download process stops. And it says that the file is corrupted if you try to open it. Interesting problem.
Sam January 17, 2007
Wow that is awsome. I was looking for some code for that functionality for hours on the internet. I am happy I finaly found a solution :)

Thank you
solidus.it [anti-spam] gmail.com January 22, 2007
Hi, I found this script very useful.
I'm wondering if is possible to allow downloads with a download manager, such free download manager, when I start the downloas, it auto stop.
Thanks
harshinichandra [anti-spam] yahoo.com January 27, 2007
hi..i need a script for access log.i ll be a very grateful if u mail with in one week..its badly neccessary for our project!!!
March 5, 2007
Great product. installed in seconds. worked perfectly 'out of the box'.

greatly appreciated.
posterlu March 12, 2007
The recursion into subdirectories does not quite work. It for example takes the first file by a certain name it finds and uses that. Try having it bring images that have both fullsize and thumbnail versions =)

I bypassed this by using the direct url, but checking that the realpath(url) is within base-url.
hossein_2hi [anti-spam] hotmail.com March 16, 2007
hello,
very nice script, and its working VERY nicely.

great job.

in my site .zip files download fine, and .avi files download fine.

but i have .rmvb files. and i've changed the mime type, but now i get wird letters, and they keep loading till my IE crashes.

I just wanted to konw how to allow all files, regardless of the mime type.

thanks
hossein_2hi [anti-spam] hotmail.com March 16, 2007
also,
i tried to include download.php in my index.php.



the download.php?f=file.zip works fine
but index.php?page=download&f=file.zip shows internal server error
tulsadavid2007 [anti-spam] yahoo.com March 24, 2007
Thank you very much for sharing your code. Can you (or anyone reading this) help in one area that isn't working? Whenever I create dynamic content (NOT a file) and want to "echo" that out into a filename, it will not work on FireFox using Free Download Manager. FDM picks up the original URL and downloads that instead. IE works just fine.

Any header protocols for FDM?
mitridates May 8, 2007
Perfecto, justo lo que estaba buscando. Muchas, muchas gracias.
djsolin [anti-spam] gmail.com May 10, 2007
"File does not exist. Make sure you specified correct file name."

This is the error I get when I have installed the script. Yes, I have tweaked this with the directory in which I have the files in; not only with the lame path:

define('BASE_DIR','directory/');

BUT ALSO WITH

define('BASE_DIR','/home/user/domain.com/directory/');

AND it is still giving me the error!! Please fix this! ;)
djsolin [anti-spam] gmail.com May 10, 2007
For some reason when I changed the name in my file that I was working with, this script actually worked fine. It has a bug somewhere that needs to be fixed and hopefully you can find it. For now I will mess with it until I decide otherwise.
May 18, 2007
I am also getting this error:

"File does not exist. Make sure you specified correct file name."

I've tried all manner of variations on the

define('BASE_DIR','');
Apin May 22, 2007
i think i found something

[fixed]
mad_noer [anti-spam] telkom.net May 30, 2007
terima kasihlah atas bimbingannya!!
viva zubraq !!!
venkatpammi [anti-spam] yahoo.co.in June 11, 2007
WHAT IS THE PATH,HELLISH IT'S NOT WORKING.
djzmo June 11, 2007
it works..
http://www.zubrag.com/downloads/download.zip
btw, this script is veeeewwyyyyyy nicee~~!!
thanks ;)
Raghu June 13, 2007
Yahoooooooooooooooooooooooooo.It's Working Well.Thanks To The Script Author.
talya.nevo [anti-spam] celeno.com June 24, 2007
I am trying to use the script to download more than 1 file and can not. Do you have any suggestions - thanks.
John June 25, 2007
Hi. I recently installed Smart File Download and have come across a few problems maybe you can help with.

This is how I set up the code using my site's name where mydomain.com goes below

define('mydomain.com,'downloads/');

// log downloads? true/false
define('LOG_DOWNLOADS',true);

// log file name
define('downloads','downloads.log');

I chmod it to 766 since it did not work with 644
Is there anything on the lines above you think I should change in order to make the script work?. Thanks for helping
June 29, 2007
Installation:

1.Edit your absolute path so it look something like this.
define('BASE_DIR','/home/username/public_html/downloads_999/');

Those who get error because you forgot to put "public_html". If you enable log, you need to chmod the folder to 777. Because you need to chmod, you don't want to use your root right? so I create a folder call "downloads" and chmod it to 777.
2. Upload your PHP file to the "downloads" folder.
3. Put all your download to your "downloads_999"
4. your download link should look like this
http://www.domain.com/downloads/download.php?f=TEST.ZIP



JT July 1, 2007
all working, nice and easy, thanks!

But...

You can still copy link location (http://www.MYSITE.com/includes/download.php?f=sample.zip )paste into new browser and the file downloads without any issue? Am I missing the point here?
Laban July 2, 2007
Code of great value here. Bumped into a problem today. set_time_limit is rejected by safe_mode, and if errors are displayed headers won't go, and there you go for file content display in page.

You can remove set_time_limit line, or modify errors settings. Chose first.
Rene July 6, 2007
Very neat and very usefull script! Excellent work, thanks!

One remark: the logfile only works if you include the full path in the logfile name ;-)

Cheers!
Naveen July 8, 2007
Is there anything special to do with Content-Type for .rar files
Gav July 9, 2007
how do i make this work with .iso files
mariogarcia_ar [anti-spam] yahoo.com July 17, 2007
Hi, Great Job
Mario Garcia
nicelens2000 [anti-spam] yahoo.com July 18, 2007
excellent .. thanks
spam [anti-spam] idle.se July 21, 2007
Hi

Works fine for .pdfs but when i try with a .doc the .doc is corupted when downloaded thru the script, also the .pdf reader asks every user if they want to save changes after they have only viewed the .pdf. Im running apache under FreeBSD. Is there anything i could check?
arwin July 21, 2007
for MIME Reference:

http://www.w3schools.com/media/media_mimeref.asp
July 24, 2007
Thanks++ put to use in my website.. just wanted to ask.. does this have any known security issues ?
Vinod July 31, 2007
I am running this script on one server with fine results, but at the same time using on other server file gets corrupted on download. WHY?

Can u please help me.

Thanks in advance
August 4, 2007
Hi. I read somewhere here that in the define (BASE_DIR) area no URL should be included, but yet I read someone here used his domain name instead and got confused. Could I include my domain name without the http:// or is that meaning the root server for the domain name should be included instead?. Thanks for helping
saurabh August 23, 2007
I am a complete novice and trying to put this feature on my website. I have no idea what a root server is. I am using front pafe to design the website. Can someone tell me step by step what needs to be done.
sameema August 26, 2007
Works good. Thanks to the script author.
August 27, 2007
Download Resume supported???
tnp August 31, 2007
Nice code. I don't need it as it is, but it serves as a good example for what I am doing.
Adam September 17, 2007
thank you very much for this script, it works really well, and so easy to use
Black Smoke September 20, 2007
Wow... Really i found awesome. thanks... Guys for creating this solution...

Great Work Guys...

from Sag-e-Attar Junaid Atari
www.bsdeveloper.com
javed_kgardezi [anti-spam] yahoo.com September 24, 2007
hi,
I am using win xp, any one can complete guide me how to use Smart File Download. Some one explains the steps to use Smart File Download in windows XP. plz email me at javed_kgardezi@yahoo.com
i shall be very thanksfull to you.
Scott September 27, 2007
Hi,

This is the error I'm encounting at the moment. Any chance of explaining what is happening?

Currently running on a Linux Machine. Trying to download file from IE 6
Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/Resource/IST07/) is not within the allowed path(s): (/home/teaching/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/teaching/public_html/Junior/downloaddata.php on line 83

Some web hosts prevent you from accessing files outside of your directory_root directory. That is what causes this error.

If you are using byethost.com or swiftphp.com (same company same restrictions) you can not access files outside of directory_root.
yanyan October 5, 2007
thank you thank you sooo much. you helped me alot. :)

God bless
admin.virtual [anti-spam] gmail.com October 7, 2007
i want to be able to download a random file from a set of files in a folder. could somebody sugest how to do that.
Bokito October 7, 2007
Thanks, really usable and well documented script. I will be sure to check out the other stuff on your site. Thanks again!
cfor011 [anti-spam] hotmail.com October 8, 2007
I want to be able to download doc file or pdf file could somebody sugest how to do that
multimedia [anti-spam] amvdesign.it October 16, 2007
Good job! it really works
THANKS
October 17, 2007
It's great it's work very good...
Matt October 18, 2007
You = lifesaver. Thank you so much for this script.
pervez_musharraf October 20, 2007
Excellent script. Suprised you have been able to achieve this with just one page. There is a similar script at gentlesource. However, it has a complex structure and leaves its url on each file (big nuisance). It is able to count the downloads for each file (advantage) while yours lists each download separately. Good work.
Wagner October 28, 2007
Muito Obrigado, Funcionou Perfeitamente!!!
I Will find for a simple and functional script like this!
manasan2002 [anti-spam] yahoo.com November 14, 2007
The script is not capable for multi threading. I can only download one file at a time.
November 20, 2007
You should include an updated script to protect filepaths even more. I modified the script so that it picks up the filename from the database, and hence you only supply an ID for the download.
Downloads then look like this: domain.com/download.php?id=30
John R November 23, 2007
Excellent php script! Simple and elegant. Worked well from the beginning, and easy to customize and integrate into my site - Thanks!
Slava S November 23, 2007
I just wanted to thank you for this excellent script. Easy to integrate, works fine righ away.
acakeb10 [anti-spam] caledonian.ac.uk November 26, 2007
Notice on download it only allows one port for download. Any way I can change this?
rawat167 [anti-spam] gmail.com December 14, 2007
Please Help Me I want to do download any file on your system while click on giving link
robby December 19, 2007
Works perfectly! This was just the example for which I was looking.
Salik December 20, 2007
Absolutly Fantastic Work (Y)

i hope this work is fully secured
madhus.spl [anti-spam] gmail.com December 28, 2007
Thanks zubrag.com this is script used for me a lot
thank you very much.........
this will surely help us very much to secure our site
thanks Lot once again...
Regards
madhu
Chief_runningwater January 8, 2008
Won't seem to work for me
January 9, 2008
it doesn't work for me :S
"Warning: opendir(/home/user/downloads/) [function.opendir]: failed to open dir: No error in C:\apache\www\download2\download.php on line 95

Warning: readdir(): supplied argument is not a valid Directory resource in C:\apache\www\download2\download.php on line 97
File does not exist. Make sure you specified correct file name."
rohit sharma January 10, 2008
can any body give php script to send email to inbix
January 13, 2008
Hi. It took a couple hours but I figured out how to make this script function. And unlike some that will only give bit and pieces for you to puzzle together for your self, I will send a detailed "how to" file along with all the components to whomever wants it. Just email me at turner2f@yahoo.com Cheers! Thanks for making the script!
geo January 15, 2008
Hello, Thanks a lot, keep up the good work
January 18, 2008
I have the script working, but for some reason I can't get it to track .wmv video downloads. When I use it to track a .doc it works fine so i know i got my paths, and permissions set right.

I added:
'wmv' => 'video/x-ms-wmv'

So it lets me download it but it just doesn't track this specific filetype.. Am I doing anything wrong here?
markaf [anti-spam] mit.edu January 20, 2008
Great script, thanks very much for putting it up. I have one minor question: using IE6 to download a file, say, edu.uni.java_1.0.0.jar, I get "edu[1].uni.java_1.0.0.jar" as the 'save as' filename. Any ideas why, and any fixes known? Many thanks for your great script.
alto [anti-spam] bluebottle.com January 25, 2008
hi zubrag

thankyou thankyou, this script looks good!
thankyou for all your efforts and sharing them with us ...

everything working ...
i have 2 needs
QUESTION
how do i force "save as" dialog.
when in IE, the download immediately is downloaded by my download manager which opens and begins downloading, revealing the download URL.
cannot utilise your wonderful script until i can force"save as"

any clues for me?
thankyou for your time...
alto
eric [anti-spam] designedbyeh.com February 1, 2008
Can I use this across two different domain? I need to store media files on a different server? So, can the path be to a different domain?

February 4, 2008
hye.
i really need to know how to read .txt,.html,.pdf and .doc file using php codes?
DasBrose February 6, 2008
Nifty! A very useful script.
yuri [anti-spam] post.com February 13, 2008
The Best script in the Net.
If authors could add temporary functions to it to avoid constant downloading for payed links - it could be the most substantional contribution of PHP in our lifes!
uma February 16, 2008
i want to attach a pdf file without using browser control
radman February 19, 2008
thanks for the file. I will use it in my new site: http://www.midisharing.cn
belcherds [anti-spam] concord.edu February 19, 2008
I am a novice programmer (at best), when I used this script, and clicked on the link that should have brought up the download, it displayed the code for the download.php page. Can anyone help me configure this better? thanks
senthilk [anti-spam] peppersquare.com February 22, 2008
Code is superb. But can you give me one example file to do easily. That is very useful for new programmer. Thanks. Great!...Code.
dwmsyron February 24, 2008
You have a section towards the end to remove bad characters, eg:
" ' \ /

You might want to change this to:
\ / : * ? " < > |

These are valid on many file systems, but they are invalid on Windows:
http://support.microsoft.com/kb/177506

Thanks for the script!
March 6, 2008
Great script Zubrag!
Is it easy to add a timeout on the links? Time out after downloaded 3 times from certain IP address. I'd definately pay for this.
jllanten [anti-spam] rocketmail.com March 13, 2008
Works great ! thanks a lot for the script. Will keep on visiting more this site
Andrew March 17, 2008
Thanks, works great. Appreciate you making this available, you just saved me a few hours...
razibmiah [anti-spam] gmail.com March 20, 2008
Thanks.
I am using this www.razibmiah.com
gadelkareem.com March 22, 2008
yes timeouts should be a great addition..
asasha March 22, 2008
would this script be indexed using http://gadelkareem.com/2007/12/10/sitemap-creator-02a-create-sitemaps-09-valid-for-google-yahoo-and-msn-sitemaps/
is it seo wise ?
levi March 24, 2008
works great - thanks for the effort
ktweezee [anti-spam] yahoo.com March 31, 2008
great script. i used it with a form to obtain some data before downloading. awesome!
April 2, 2008
How can I add the username (an maybe soemother information) to the logfile? Users have to auth with an NIS account to get to the webpage, but I don't know how to grab the username and add it.

You ROCK!
April 4, 2008
Thanks.
Ardian April 5, 2008
FLM
Kevin April 8, 2008
Muchas gracias!
hrvoje April 9, 2008
I added
'tar' => 'application/x-tar',
'tgz' => 'application/x-compressed-tar',
'tar.gz' => 'application/x-compressed-tar',
under archives group
regargs
binu April 16, 2008
wonderfulman
ceeby April 18, 2008

Having some real trouble getting this to work :( It's back to the "Cannot Find Directory" problem.

When I see this:
define('BASE_DIR','/home/username/public_html/downloads');

Am I to think that everything other than "home" is to be changed to my own particular information?

Just trying to figure this out... I'm a noobie so I'm having some trouble.

My site is www.ceebysite.com and the download.php file resides in www.ceebysite.com/movietestflash/download calling for the file "download.zip" in the same directory.

Here's the total path that comes up when I try to run it:
C:\Sites\Single49\ceeby\webroot\movietestflash\download\download.php

Any advice?

Many thanks in advance...

chris
kimwatts2003 [anti-spam] yahoo.co.uk April 21, 2008
Works fine. Had to include the rar mime type but other than that, no problems.

April 21, 2008
Very nice, thank you for this!!
April 23, 2008
Zubrag, you must have a step by step procedure along with the Php script for us stupid people who are new to php.
timG April 28, 2008
Below is what I get when I press the link to download.

Warning: opendir(/downloads/): failed to open dir: No such file or directory in /" "/download.php on line 95

Warning: readdir(): supplied argument is not a valid Directory resource in /" "/download.php on line 97
File does not exist. Make sure you specified correct file name.

this is the full path to the file I want downloaded
http://iced-preview.com/downloads/BookStore_Pricing.psd


This is the link
<a href="http://iced-preview.com/download.php?f=downloads/BookStore_Pricing.psd">Download Price List</a>

This is what I put for the directory
define('BASE_DIR','/downloads/');

I also tried it with the full path and got the same result.

I'm sure there's a simple solution to this but I'm very new to php so I would appreciate any help. thx
Freak April 28, 2008
HI.

You have to erase the slash in front of download. Then it should look like this:

define('BASE_DIR','downloads/');

and work just nicely.
greetz.
May 2, 2008
Hey, Is there any way to download file using this script present on other server?
hiding the actual url of site and its location?

Best Regards,
Ritesh Jain
May 3, 2008
Thanks
tolvhundra [anti-spam] hotmail.com May 5, 2008
Please help me!!! it works with FF but not with explorer or safari to download files.. if i download it with safari and i try to open it i get a error message "broken file" what do i do? please help me!!
aliaydin May 6, 2008
nice job and thanks
May 7, 2008
Thanks dear.. its very easy to integrate. had intergrated it..

webfundu.com

May 13, 2008
Hi
Script is working great..
But i am using this script for video downloading...
But the file is open and play automatically...
what is the solution for that...
thanks
Udhay
gee [anti-spam] exclusivemail.co.za May 14, 2008
Hi! This is the error i'm getting please help me. I've tried to change define('BASE_DIR',"") but still...
martin [anti-spam] prefix.co.za May 15, 2008
Hi,
When you tried to open files directly from the brower, it will download but give an error when trying to open the document.

Thanks so much. We have had this problem in IE6 for a long time and this resolved this issue.

Thanks again.
kaspar.mary [anti-spam] gmail.com May 16, 2008
Hi,

Its nice and simple script. any one can understand, thanks a lot for giving this.

am facing one in this script - i can download the file from my site into needed folder but i cannot open it, because it just copy the name of the downloaded file only, there is no content in this, thats y i cannot open/play it.

Plz give a solution for my problem to my mail id.

Actually am testing this localhost only
am getting confusion to give path.
C:\Program Files\EasyPHP1-8\www\project_name\downloads.

now am giving the base_dir - './downloads'.

chinmayee May 19, 2008
hey.. it's working fabulous...
thanks a lot for giving this free script..
ashwani.bhardwaj154 [anti-spam] gmail.com May 25, 2008
i want to download php file reader
142905 [anti-spam] gmail.com May 25, 2008
This script works fine with Mozilla and IE6 but still not working with IE7... The page takes a lot of time to load (as if its processing the request) and then gives an error;

Internet Explorer cannot display the webpage

Any ideas....
riesurya May 28, 2008
I've been using this great script since ver.1.21 and it works well. Tx a lot
Spinner May 28, 2008
The main thing about this page is that everything is just too vague for me! I can barely even understand what I'am about to do next as I install this script into my directory!

What do I do?
Who knows!

The page at zubrag.com that claims to have developed the script left me with xxxtremely inadequate instructions on how to use, install, and modify this script!

I tell ya,
...
I'VE LOST MY MARBLES!!!

Best Regards
~Bob
June 6, 2008
Wow. Simple. Thanks for the script. Took about 2 minutes to customize and upload to server.

If you're having trouble you either don't have a php enabled server or you need to take a lesson in basic web development.

-Thanks again,
-Christopher
ryan June 16, 2008
I have searched 4 months 4 a script like this, You guys are great OPEN SOURCE 4 life, i love this script it saves me
from loseing bandwidth and from prying eyes everyday.
June 16, 2008
damn people, how 'bout reading the damn comments on the file?

why are you bitching that you cannot use the script? did you paid for it?

if your skill is not enough to tamper with basic code, then look for commercial solutions, I bet there are plenty out there.

thanx for the script dudes.

(I'm struggling with the hotlinking part, but I'll get around to it)
June 17, 2008
Excellent script. Thanks a lot
newbie June 17, 2008
need tutorial for the code..
someone plz help..
ximenamay [anti-spam] hotmail.com June 24, 2008
Works great! I had to struggle with the path but it just took me some minutes. Thank you for your generosity
&#1053;&#1077;&#1085;&#1072;&#1076; June 24, 2008
It is just excelent code, working perfect. Nice job, and thanks a lot.
matrim [anti-spam] usbanime.com July 9, 2008
Script works nice. though I made a change for security reasons.
changed :
$fext = strtolower(substr(strrchr($fname,"."),1));

to:
$fexplode = explode(".",$fname);
$fext = $fileexp[count($fileexp)-1];

This in order to prevent the use of . in file name
if a file is named "john.doh.jpg"
the original script puts "doh" as the $fext, what mine does it that it always takes the last argument, putting"jpg" in the $fext variable
matrim [anti-spam] usbanime.com July 9, 2008
Just noticed that I missed the strtolower();
Fix:
$fexplode = explode(".",$fname);
strtolower($fexplode[count($fileexp)-1]);
July 10, 2008
Great script and thanks!
consultant.ankit [anti-spam] rediffmail.com July 14, 2008
First of all thanks for your great scripts but don't know why its not working for me. The filesize function is throwing an error:
Warning: filesize() function.filesize]: stat failed

Does anyone have idea why is that??

Chandan July 15, 2008
One question, is there a way we can show download url of our site and it actually should download from some other site. ex :- www.mysite1.com/download.php?f=test.txt should download file from site2.com/test.txt ???
aliceander [anti-spam] gmail.com July 15, 2008
Thank you for the script.

Is there a SIZE limit? It works on small to medium size files but a file that is over 2gb is having trouble finding (file not found by the download script).

Will try to solve but please let me know if you there is some limit that I am unaware of.

Thanks again.
emiliodelrosarioiii [anti-spam] gmail.com July 21, 2008
Hi,

Need some help on the error "File does not exist. Make sure you specified correct file name."

And I've made a lot of tweaks. Anybody have any fix on this. thanks!
toto July 22, 2008
about file not exists, what i did it s to put the downloaded folder in the same dir (example, you put the dl.php in /home/dl/, you have to put the downloaded folder in /home/dl/downloaded/), after in the dl.php, put :
define('BASE_DIR','downloaded/');
tata July 22, 2008
there is a way to add a limited download number ????
there is the expire function but i would like to limit the download.
for example, only one person/ip can download 2 times, after that got error
thanks for any help
britney July 22, 2008
you can limit download number or time file is available here

http://www.safe007.com
Eva July 25, 2008
Hi everybody
I used this script befor and it was great. i changed our server and i put the new path because is not the same. it not start by home but by var
define('BASE_DIR','var/www/hghj/html/library/');it appear this message
Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /var/www/hghj/html/download.php
san_about [anti-spam] yahoo.com July 26, 2008
How to open up that php file.
can u please provide some Details
Anthony July 31, 2008
Really thanks for the script ^^
arvind.softwarex [anti-spam] gmail.com August 6, 2008
Nice script,working perfectly.
Thank you
arvind.software [anti-spam] gmail.com August 6, 2008
Nice script working excellent.
Thank you
Arvind
webwareshop [anti-spam] yahoo.com August 6, 2008
This script works fine.
For those of you with problem read this:
Hello! I want to ask that is download.php should be in same directory as the files which are to be downloaded with this script.

Because this error is displaying:

File does not exist. Make sure you specified correct file name.

my download.php is located in
public_html/download/

& downloads are located in
public_html/download/downloads/

why the error is coming?

zubrag: you can place download.php where you want. Try putting absolute path (i.e. path from the root folder) in the BASE_DIR. In your case following relative path should also work: define('BASE_DIR','downloads/');

This is the kind of problem people are having
John UK August 10, 2008
Really useful, thanks alot.
gbl0330 [anti-spam] gmail.com August 11, 2008
Nicely Done! Thanks
bluly2000 [anti-spam] yahoo.com August 12, 2008
i am having error as "Warning: Cannot modify header information - headers already sent by (output started at /home/x4wards/domains/4-wards.com/public_html/user/download.php:2) in /home..."
What can I do??Is it any sample working link that I can refer?
August 14, 2008
Thanks man your the One
But i wanna ask how to enable Resume Download
Anatolij August 18, 2008
I've added also mod_rewrite rule to complete the cool functionality. You can use this one:

RewriteEngine On
RewriteRule download/([a-zA-z0-9\.\-]*) download.php?f=$1

Add to yout .htaccess file and you can access your files viw the: www.yourdomain.com/download/your-file-name.ext

mahmud_shaheen [anti-spam] yahoo.com August 19, 2008
i download it.i am new programmer .where to change please tell me.i use wamp server.
August 20, 2008
789
zion August 20, 2008
Hello, Thanks for your great work.
but I have some problem.
When i place links in flashget, its seem i can't continue download file but to restart download again.

How can i allow to continue download via flashget?

Thanks.
mahmud_shaheen [anti-spam] yahoo.com August 20, 2008
i want to use your scripts.please help me.i download your script and save C:\wamp\www\downlaods folder. and same for log file C:\wamp\www\downloads.log
but i don't understand where to put download web site or link or URL .suppose i want to down load this link "http://www.4shared.com/file/54305152/cea4d5c0/System_Analyst.html.please help me.i am very new.
mahmud
manas.mailto [anti-spam] gmail.com August 21, 2008
Good Script,
I found exactly what I want
tina August 22, 2008
Hello and thank you for a great script. I had it up and working within 20 minutes. Wow. Good job.
Shravan August 23, 2008
Very useful script!! Good Job!
Chetan August 23, 2008
I was looking fot this and hti is really Amazing!
Chetan August 23, 2008
Hey guys.. i accessed the log file and it displays
something like
08.23.2008 7:31pm 96.232.239.239 CUJNBsow1UPAeMz0DHXG.MP308.23.2008 7:35pm 59.182.10.50 UJrfDOiuool1QhxEC1b4.mp3


that would be great if it can make some spaces before starting the Next Mp3 file... Because that will be easy to look into it..

i tired adding few spaces after @fputs($f, date("m.d.Y g:ia")." ".$_SERVER['REMOTE_ADDR']." ".$fname."\n"); but it never worked... please Help.
Emil August 25, 2008
Hi
Good script!!!
I would like to ask if this script can allow force downloads? Because I usually have our users download PDF file, I need them to download it directly on their computers. Thanks.
satinoctopus [anti-spam] gmail.com August 26, 2008
I wanted to build a script to download a PDF file after extracting it from a zip file in order to save disk space. I took the script proposed here as example, and i wrote a code that works well in Firefox, but in IE 7, I get a message saying that the file could not be opened because the file is not of the right type or because it is damaged.
This is the relevant code:

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=\"".basename($zipentryname)."\"" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".zip_entry_filesize($zipentry));
print $buffer;

Any idea? Thanks a lot in advance
Madhu August 26, 2008
Working Great

Thanks alot

Peter August 27, 2008
Hi
I'm using Win and IIS. The problem is that in binary files some empty characters are replaced by '\0' after being processed by the script. Text files work fine. Please help to make it work with binary files :) Thanks.
darrenewing [anti-spam] earthlink.net September 22, 2008
This code is completely awesome! THANK YOU! It turned literally hundreds of hours of failure into great success (mind you that's TWO YEARS after you originally uploaded it!) Cannot Thank You enough!
angelo September 30, 2008
hi,

after the download link i want to add dynamic data!
something like :
"download.php?f=" . $row_DetailRS1['downloadUri'];

everytime i try this i will get the error file not found or specify a filename.

how can i combine the string to dynamic mysql data?

please help
mr.amitabhsingh [anti-spam] gmail.com October 8, 2008
how can we use it because of i can't understood it variable also so please help me for undrstanding this script...
thanx
regard
Amitabh Singh ....
amitabh October 8, 2008
i want this download code of php.
and i request to all person who has solved his problem through this code so please send me that related folder.
which can i deploy in wamp
please help me
mr.amitabhsingh@gmail.com
reyn_rjc [anti-spam] yahoo.com October 10, 2008
Please help me on how to download files from my pc using the php scripts.
Sonali October 11, 2008
I m Sonali,hi 2 al
9880314583 Dis is my number Contact me i want some help from u frnds
scribzy October 22, 2008
Just what the doctor ordered thanks a lot and keep up the good work!
arasan [anti-spam] mahiti.org October 23, 2008
i've used this code but found that its slower than the ordinary download. Help me regarding this
mike [anti-spam] rowla.com October 26, 2008
Fantastic script thanks! If only just for forcing downloads!
patideepchand [anti-spam] gmail.com November 4, 2008
hi there i think it's a great script..now im using...it's works fine..but
while downloading suddenly 50% to 80% it's stoping and showing completed...i don't know why..could anyone plz help me
Irwan November 4, 2008
Awesome, great script.
i have been using this script since i found it. very easy to use it.
i changed the script using id_file and work perfect. thanks
anigart [anti-spam] hotmail.com November 6, 2008
Hi there,
I found that there is an issue with this (and many similar scripts): when using IE 7 or 8 beta2, and clicking cancel in the download box instead of downloading the file, it is not possible to navigate anymore on the site or download again (script seems to hang somewhere). Seems like it's a bug in IE since it works with Chrome and FireFox (Safari works once but will also hang when doing it the seconf time). I spent the last 2 days trying to workaround this, if anyone knows a solution it would be greatly appreciated.
Thanks,
Anigart
November 7, 2008
First GRAT downloader THANKs
I have a question:
How I can define more directoryes?
THIS UNDER IS IMPOSSIBLE BECAUSE WE CAN'T DEFINE MORE $Var in define function... but I need somethink like this:

$kind = $_GET['kind'];

// Download folder, i.e. folder where you keep all files for download.
// MUST end with slash (i.e. "/" )
if ($kind=='mp3promo') {
$BASE_DIR=$PATH_mp3Promo;
} elseif ($kind=='mediaifle') {
$BASE_DIR=$PATH_mp3;
} elseif ($kind=='RealAudio') {
$BASE_DIR=$PATH_RealAudio;
}

define('BASE_DIR',"$BASEDIR");

Thanks 4 help
respect
GioMBG
sssss [anti-spam] yahoo.com November 8, 2008
i got a earror

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /mounted-storage/home95c/sub001/sc1084824-EIBI/www/Files/****/download.php on line 81
Please specify file name for download.
anderson [anti-spam] unifal-mg.edu November 10, 2008
just pdf files are needed by me and
it works perfect! thank you a lot!
November 10, 2008
A great script - thanks very much. Worked first time after only minutes of setting the paths. Thanks for sharing open source.
fritze November 14, 2008
I have been looking for a script like this for months. This script is great!!
<b>THANK YOU<b>!!
Emiel Wieldraaijer November 21, 2008
Thanks nice script..

is it possible to redirect to a an url instead of displaying some simple text

// If hotlinking not allowed then make hackers think there are some server problems
if (ALLOWED_REFERRER !== ''
&& (!isset($_SERVER['HTTP_REFERER']) || strpos(strtoupper($_SERVER['HTTP_REFERER']),strtoupper(ALLOWED_REFERRER)) === false)
) {
die("Not allowed. Please visit http://www.domain.com/error.");
}

Thanasis Delenikas November 22, 2008
Great script, thanks for sharing!
November 23, 2008
Use fpassthru($file_path)

It's a lot more efficient than using a manual read/write loop.
bhupindermalhotra [anti-spam] gmail.com November 25, 2008
nice script thanks
alam19bd [anti-spam] yahoo.com November 29, 2008
tnx tnx tnx a lot lot the author
it is grt job. i was searching for this scripts for a long time.

i am using this script here http://www.banglaeye.com/music/index.php?page=songs&album_id=2

tnx again

Alam
www.digitechvalley.com
ram December 2, 2008
Hi All, I new to learn java script, please help me, I want download a file from another site through java script.

For example I need download this link http://dc95.4shared.com/download/22521633/a0584f5c/WroxProfessionalJavaScriptForWebDevelopers.pdf?tsid=20081202-061821-e0608f87
from my blog. what to do? send me the code pleeezeeee
ram December 2, 2008
my email id: ram.g@live.com. please help me inthis regard
sheetalbansal.acs [anti-spam] gmail.com December 4, 2008
Excellent!after changing some code it is working.Thanks
a [anti-spam] a.com December 16, 2008
It's really great
wiser X hellwap December 17, 2008
good work.
jules December 20, 2008
Thanks so much for this.Works like a charm for me and saved me a lot of headaches.
Merry Christmas
faltu [anti-spam] khola-janala.com December 21, 2008
Warning: opendir(/home/user/downloads/): failed to open dir: No such file or directory in /home/k/h/kholajanala/public_html/video/download.php on line 95

Warning: readdir(): supplied argument is not a valid Directory resource in /home/k/h/kholajanala/public_html/video/download.php on line 97
File does not exist. Make sure you specified correct file name.

--------------
I get this type of err. What can I do??
http://www.khola-janala.com
December 23, 2008
Thank you.
Very simple and it works!
Bogdan December 26, 2008
It worked from the first time! This is the best!
vsvnmurthy [anti-spam] rediffmai.com December 26, 2008
THAT'SSSSSS....GREAT SCRIPT..THANKS BROTHER...
IF I HAVE GOOD PAY , DEFINETLY I MIGHT HAVE DONATED SOME AMT...
PLEASE MAIL ME SUCH USEFUL SCRIPTS..
THANKS ONCE AGAIN..
pkendre [anti-spam] adjility.com December 29, 2008
How can i download the file with extension '.xlsx'(excel document written in office 2007).

please help me, am stuckkkkkk
happy_v December 30, 2008
My first PHP script ever, and it works!

If I can figure out how to ask for a password, I'll be set for life.
salnazi [anti-spam] gmail.com January 5, 2009
Can you please guide me...how to use this script
sqamarabbas [anti-spam] yahoo.com January 5, 2009
i have uploaded some pdf files which can be download by your script at
www.alibrary.org/abookonline.php
it worked fine but today when i downloaded 1 pdf file on my computer i got this message"the file is damaged and could not be repared" i downloaded other pdf files but message was same . can you guid me?
dizsel74 [anti-spam] hotmail.com January 9, 2009
Gracias desde Mexico, muy chido codigo.
Thanks from Mexico, cool script.
vitalka9 January 10, 2009
nice :D
robert [anti-spam] 4elanclose.co.uk January 13, 2009
I'm using this script but for some reason an Excel file I have which is 131K is appearing a 262K when it downloads. I assumed this was to do with binary transfer but it seems not.

Any good ideas on what to test?
Sman January 18, 2009
is there any way to Crack someone else's coding?
Irina January 19, 2009
Brilliant once again!!!! thank you soooo much!
Abdul January 22, 2009
Warning: opendir(http://www.domain.com/images/): failed to open dir: not implemented in c:\appserv\www\download.php on line 97

Warning: readdir(): supplied argument is not a valid Directory resource in c:\appserv\www\download.php on line 99
File does not exist. Make sure you specified correct file name.

WHY I AM GETTING THIS ERROR?
Thank you in Advance...
vishusahu [anti-spam] gmail.com January 29, 2009
whatever the files I am downloading using this script getting corrupted. I tried with .zip, .doc file. after download, the zip file is not extractable. doc file showing error on MSWORD. is this file required any kind of php setting or setting in apache configuration file?
Thankful January 30, 2009
Hi,
Thanks so much for the script. Your script helped me in clearing a big road block in my project!
Cyndi C January 30, 2009
Perfect! Thanks!
Shoaib Khan February 2, 2009
Work great! I got what I want.
Thanks,
Sadanand, sadanandwarty [anti-spam] gmail.com February 7, 2009
hi, I want to download the "DROWNED OUT" VIDEO from the following website:

http://www.spannerfilms.net/?lid=98

Plz tell me what I should do. I am a bit beginner in these script things....so, it would be nice if you explain the procedure in detail.

Thanks in advance
Sag-e-Attar Junaid Atari February 12, 2009
Its really nice man!

Thanks for uploading it!

Get me:
http://blacksmoke.co.cc
madhavpan [anti-spam] yahoo.com February 12, 2009
hi my name is madhav.

i used your smard file download script for the download links i works well and good for the files around of size 10 MB but it i am facing a problem when i was giving the links of zip folder of size more than 50MB. it is not downloading compleately its getting stop after downloading file of size 15 MB to 20 MB
can you give a solution for over come this problem.

Thanks
madhav.
rana_3098 [anti-spam] yahoo.com February 16, 2009
AVG anit virus which the file download.please about it. Sir
ouya.oulai [anti-spam] gmail.com February 19, 2009
If u want to use this script to download chinese or something encode with UTF-8, u can use urlencode() to encode file_name. (for IE download) (FF just use incov() )
By the way, Thanks for sharing!
February 23, 2009
gracias por el codigo, funciona perfecto!
skyblue February 24, 2009
Work really great!
It even can define open file type.
But user must remember to adjust the "BASE_DIR"
punjabi_guy01 [anti-spam] hotmail.com March 3, 2009
thankyou dear for nice script
March 3, 2009
excellent!
i put your script on my site and it's awesome!
http://www.rebout.com
Mayur March 3, 2009
Good job. Thanks :)
luciaruban [anti-spam] yahoo.co.in March 5, 2009
i got one error,Please specify file name for download.
how to use this script? $file_path=? we must give the path? i put online/online.php it's correct? please reply me how it will be used?
gerard [anti-spam] k-bros.co.uk March 5, 2009
It would be great to get username and write to log, as my downloads are in a passwrod protected directory??
Goodboy March 6, 2009
Parse error: syntax error, unexpected T_IF, expecting ')' in /home/user/public_html/download.php on line 49


i am getting this error..please help me
madbrit March 11, 2009
Have set up the files and uploaded it to my server, but when i call up the script all that is shown on the page is "Please specify file name for download." can anybody help. thanks
kittu07_babu [anti-spam] yahoo.co.in March 14, 2009
I want a sample program to download a file in php in clientside using file concepts
kittu07_babu [anti-spam] yahoo.co.in March 16, 2009
I want a sample program how to download a file in php and description of the program
March 24, 2009
In my PHP application I get data from a mysql table and want to download the results to a .txt or .doc file. Can I use your script?

My SELECT statement: $sql = "Select email from table1";
sigbia [anti-spam] freemail.it March 28, 2009
i put the script on the home dir of my web server hosting

but when i call it http://www.digitalking.it/download.php?f=test.zip

it gives error, why?

in BASE_DIR i have specified:

define('BASE_DIR','/test/');

the file to download is located at
http://www.digitalking.it/test/test.zip

Thanks a lot,
Simone Italy
sigbia [anti-spam] freemail.it March 30, 2009
Now is ok, i corrected it! thanks :-)

But i tried it works with "normal" html links, and not with the forms!

For example i have this form:

form NAME="form1" METHOD="LINK" ACTION="../download.php?f=test.zip"
input type="submit" name="button" value="Click!"
/form

when i click the button it doesnt pass the link download.php?f=test.zip but http://www.digitalking.it/download.php?button=Click%21
so then it doesnt work!
naveen April 1, 2009
thank you very much your code works gr8...
clinton.brits [anti-spam] gmail.com April 1, 2009
I love the way it works but i'm having a problem in that when i run a test .exe file on my server, it runs perfectly but when you request the download using the php script and then run it it says that it's too big to put into memory but the file size is exactly the same. Is there something that needs to change besides the files location?
Angela April 2, 2009
Worked great. Exactly what I needed and saved myself hours trying to adapt something out of a book.
vijayitsoft [anti-spam] yahoo.co.in April 7, 2009
Hi,

If you can mail me any school timetable generator code in php plzzzzzzz


thanks
Toby April 7, 2009
A lifesaver of a script, THANKS!
sebastiao April 8, 2009
Many many thanks.
It is working perfect.
I saved hours
jay April 9, 2009
hi, gr8 script! does anyone knows a way to limit downloads per ip? something like 20 allowed downloads per week for a given ip?
thanks
aakash.malik [anti-spam] gmail.com April 10, 2009
hi
thanx, million of times. u've solved my biggest prob.
Victor April 11, 2009
This works great and saved me a headache. I know php and perl just enough hurt myself. Thanks a billion!
Mike April 14, 2009
This does not work correctly with sub directories. It finds the first file with the file name and uses that regardless if you specify the directory path with the file name.
paul [anti-spam] ultimate-it.com April 16, 2009
To use with sub directories:

Find [around line 86?]

if (!isset($_GET['f']) || empty($_GET['f'])) {
die("Please specify file name for download.");
}

and add this code BEFORE

//By FoxE : also get directory name
if (!isset($_GET['d']) || empty($_GET['d'])) {
die("Please specify directory name for download.");
}

//By FoxE : Now get directory name.
$dirname = basename($_GET['d']);

Your link should look like this:

<a href="http://path/to/script/download.php?d=directory&f=phptutorial.zip">Cool PHP Tutorial</a>
Dave April 16, 2009
Fantastic script! Thanks. Works like a charm. Took me a little bit of time to configure .. but that was after I realized I should actually read the directions! Thanks again.
mohamed April 22, 2009
how to download a file from the server
April 22, 2009
Kudos to the author! 5 minutes to implement and saved me a load of time!
Thanks!!! :D
gandila [anti-spam] ymail.com April 30, 2009
How to download it?
from-
http://morefreelance.com/
manikjan [anti-spam] hotmail.com April 30, 2009
Brilliant once again!!!! thank you soooo much!


http://ebookideal.com/
Bunty April 30, 2009
you can limit download number or time file is available here

http://nandi-graphic-and-advertising.com/
fengz April 30, 2009
i need a step by step guide on how to use this script!
fengsky69@gmail.com
many thanks!
Mamoun May 3, 2009
Thank you very much. It's really very useful.
G Natarajan Nallinattu Nallicherry May 5, 2009
Very Nice and fully satisfied
Yawny May 5, 2009
Thanks a bunch for this script. However IE 7 complains about the hotlinking feature. It looks to me like IE7 doesn't set the HTTP_REFERER variable? which would cause line 75 of download.php to fail. In any case, this forces me to have to disable hotlink blocking.
mumun May 6, 2009
oc thanks
Me May 6, 2009
Ok let me give u my situation. I have to design my site such that the members are sent the email of the download link (which must be secured offcourse) then I have to record how many times they have downloaded the File. Previously io will have the ID and Email of the user in the database and I have to increase the number of times they download by 1 each time they download the File. Does that makes sense?
May 7, 2009
thank you, saved a lot of time.
bitulet [anti-spam] gmail.com May 10, 2009
Wao
Its really a nice,unbeliveable and so much good. From Dhaka
mahfooz-ul-haq May 15, 2009
is it possible to download file from another server using your script,
for example if my files on abc.xyz.com and i want to accept download file request only from xyz.com...

what should i do in this case???
dannet May 15, 2009
Anybody knows how to rename a forced-download from an external source without using readfile() (and not saving the file on the local server)?
May 19, 2009
Fantastic code. Well done.
Heather
darshanalk May 20, 2009
This script is very good.
I tried it and it worked fine.
Thanks and well done.....
mukeshdak [anti-spam] gmail.com May 21, 2009
This script is just fantastic and working fine for me, Thanks a lot for your efforts
prakruthi May 22, 2009
hey nice code.. it really works.. superb :0
May 24, 2009
its great.thank you very much.
georgeleru [anti-spam] yahoo.com May 25, 2009
why i can't download files with char & in the filename? Also with + ?
not May 26, 2009
Yeah, thanks , still , I found this quite funny

$FILE_PATH = '';
find_file(base_dir, $fname, $FILE_PATH);

function find_file ($dirname, $fname, &$FILE_PATH) {

.........

if (empty($FILE_PATH) && $file != '.' && $file != '..') {

.........

}

tulle__92 [anti-spam] hotmail.com May 31, 2009
Please specify file name for download.
alan [anti-spam] fiebig.us June 3, 2009
First, thanks for the script!
Second, I've done a number of file uploads, which I then downloaded using your script. The filesize of the download is two bytes larger than the original and the uploaded file on the server. Only the file downloaded with the script is larger. Using a hex editor, I can see two tabs have been appended to the end of the file (0x09 0x09). Tested files were a zip, an rtf, and a pdf.

Any thoughts? Thanks!
forgetme June 3, 2009
Thanks for this useful script. It solves a lot of my critical problems. Hopefully you guys may share more useful scripts to Opensource, Developer community. :)
Ansory June 9, 2009
For resolve this problem, can you make some example what exacly we can to do zubrag?
pleeease

real Example with you download folder and how to change on this Script.

Thanks.

pandorabox62@yahoo.co.id
colin [anti-spam] ubisan.com June 10, 2009
Great Script!

I'm looking for a variation on this that lets users leave their email address and in return, they get to download a file. Anybody got any ideas?
User June 14, 2009
Does this work for IE8? I haven't found any forced downloads via the header commands to work for IE8.
Grateful June 14, 2009
After searching and searching and trying multiple other scripts - SUCCESS!!! Thank you so much for your work! :D
jimmybbb June 18, 2009
Perfect! I was working on writing my own script when I ran across this page.. You just saved me a ton of testing and troubleshooting. And it worked on the first try. Thanks so much!
Tony June 18, 2009
Thanks, dude! Your script rocks!
June 19, 2009
iS it possible for downlaod file in remote server?

my downloaded files in the some other server eg:-www.downlaodfiles.com

my downlaod.php iscript in the www.mydomain.com

iS it possible for downlaod file from remote server ???????
ad June 19, 2009
Great script, thanks for posting this!

User, it works fine with IE8.

mithu June 29, 2009
great...thanku very much.....
woo July 1, 2009
there are somone ask and me too.
how to modify this script to works if file downloaded in other website?
Jonathan July 2, 2009
Great Script !
Thank you ! =)
July 3, 2009
it works well.
thank you very much for the script.
July 6, 2009
thanks ok???????
Paul July 6, 2009
Nice script! Thank you!!!!
Kalle H. V. July 11, 2009
I was searching for this script for 4 hours now. Works 100%, very very easy to install and make it fit with mysql logging or whatever you wish :)
Thank you. Keep it up.
newbiePhp July 12, 2009
Thanks leaps! It works great!!
July 15, 2009
How big is the largest file you tried? i tried 800+ mb and the problem seems to bee that the webserver first echoes everything into the website before the download begins
linux admin July 16, 2009
It depends on webserver configuration. Looks like your web server is setup to buffer data before making it available to client
jfrank July 17, 2009
Great script! Easiest to implement ive found.
jhill July 22, 2009
I've renamed the script to download_happnin.php because my site already has a download.php. This script works beautifully except when I test my site with IE5.5 Mac when IE 'puts up a dialog claiming the filename is 'download_happnin.php' and not the filename I'm downloading. If I do 'Save As...' this name is shown as well but the actual file downloaded is correct and has the right name. Weird. Here's hoping there aren't many IE 5.5 Mac users left out there.
Gracious July 23, 2009
Thanx, Zubrag.

These ungrateful creatures want something for free and then complain about it. Some dare to even grouse instead of making a polite request. Please keep up the good work and much success to you!
awaiskazimi [anti-spam] hotmail.com July 24, 2009
Great Script man, helped me too much... However, please specify in your file to change the BASE_DIR constant to the url of the file at server... anyway, thanks a lot...
viswanath July 29, 2009
thank you. my task was done very easily...
jayaprime [anti-spam] yahoo.com July 29, 2009
Worked immediately, excellent explanations, and even a little bit extra... yet most importantly... it worked. Thank you!
karthik August 5, 2009
great script
irshad August 5, 2009

Warning: opendir(http://localhost/filedownload/) [function.opendir]: failed to open dir: not implemented in C:\wamp\www\filedown\download.php on line 95

Warning: readdir(): supplied argument is not a valid Directory resource in C:\wamp\www\filedown\download.php on line 97
File does not exist. Make sure you specified correct file name.


I have tried a lot changed basedir ,added $dirname..but nothing works.
vil August 6, 2009
Thanks Zubrag, great job...
riazmohammedvk [anti-spam] gmail.com August 7, 2009
Dude
Gooooood script:) Thanks for it !!! :)

even i need a script that when user click the download links, it's should ask email address. Then the download will be started if the user email given !

Anyone have the script ))))
Please let me know !
Trinidex August 8, 2009
Brilliant!
Thank you!
Works a treat for my needs!
vyas.dhruv [anti-spam] yahoo.com August 13, 2009
can u guide me for *.lrc format ??
August 16, 2009
great script
thanks a lot....
August 16, 2009
can u plz tell me how to set permissions???
Craig August 17, 2009
I can't believe some of the ungrateful comments!

Thanks dude, great script. Made some mods to write the log file to a database rather than the flat file, works a treat.

Cheers
skillsongs [anti-spam] gmail.com August 26, 2009
Hi Sir I download you are fil,i have songs web site & i want hide my real links.but i dont knw php useing can you help me? i waiting u r reply sir
& i try to undastadnig this php code
Kabuloso August 27, 2009
Very good. Save my life! kkkkkkkkkk
djbahati [anti-spam] yahoo.co.uk August 31, 2009
Wow Wow thanks a lot for the interested script. I have been looking for this about 3 days.
Thanks once again and God bless you.
Nandaa [Kenya] September 2, 2009
I've just downloaded the script, am going to try it and get back to u ASAP. Great stuff man!
no-thx [anti-spam] mail.ru September 3, 2009
Thanks! You really helped me!
Kalessin September 4, 2009
This script was the first result on Google, and I had originally planned to take the bits I wanted and reuse them. However, it works in exactly the way I wanted right "out of the box"! Thanks very much.
edharries [anti-spam] gmail.com September 14, 2009
Hi, very please I found this, only having one issue with the log file.

In the download.php file, I have specified ../epk/downloads.log as the log file location, but when i go to the correct location there is nothing shown in the log file? I hope you can help
limyzhi [anti-spam] yahoo.com September 15, 2009
how come after i download a word file, the content of the word file can't show and it show a lot of symbol.
muzikis September 17, 2009
Awesome! Thanks!
rsmaha2007 [anti-spam] yahoo.com September 18, 2009
I have registered in fourm .I cant post . how to post?
vmsrodri [anti-spam] gmail.com September 21, 2009
It work's well for me. Tanks for the code.
I just added the new MIME types for office 2007. http://blogs.msdn.com/vsofficedeveloper/pages/Office-2007-Open-XML-MIME-Types.aspx
September 23, 2009
Great! Fast simple and powerfull
naseemkhanm [anti-spam] gmail.com September 29, 2009
More MIME (Multipurpose Internet Mail Extensions) is an Internet standard for describes message content types.
Check this link
http://www.w3schools.com/media/media_mimeref.asp


http://www.phpproficient.com/

October 2, 2009
Thank you.
milind_more1977 [anti-spam] rediffmail.com October 6, 2009
Really use full thank to all forum team
StresSdidri October 9, 2009
thank you very much
Jayesh Prajapati October 10, 2009
Really, Its Excellent job.
saliljain25 [anti-spam] gmail.com October 15, 2009
Hey this is a really great script but i'm facing a small problem, everytime I try to download a file , I end up with a file called download.php.jpg (for a file "SCAN.JPG")
Please help me!
Thank You
October 16, 2009
good script. It worked!!
Nina October 16, 2009
It is helpful!!!
r.bogartz [anti-spam] comcast.net October 16, 2009
Hi. This looks like a great script but I'm getting an error: Warning: opendir(/download/) [function.opendir]: failed to open dir: No such file or directory in (file location). Do I need to do more than just designate the base dir?

Thanks in advance.
October 20, 2009
This is a very good source code.

God bless.
denice October 21, 2009
What about download.php as a cronjob? Is it possible?
October 21, 2009
Great script! I was having a problem with my old script when using IE8.
October 24, 2009
When i click "download" button to download any docs from gmail, it wont open. insted it will ask to save. How to change settings to open any files before saving?
Peter October 26, 2009
How can I make the script download a file from a different server or a different web address? Is this possible?
Program Useless October 31, 2009
Can't get arround the "file not found problem no matter what I try... Gone looking for a program that WORKS!!!!
Ash November 3, 2009
I love this! Thanks so much for the script - works like a frikken bomb :) You rock!
cyclops4real [anti-spam] yahoo.com November 10, 2009
Warning: set_time_limit() has been disabled for security reasons in /home/www/downloads.awardspace.us/Downloadsafterwor/download.php on line 81
Please specify file name for download.
Mart November 10, 2009
This works great! Just took a couple of minutes to get the BASE_DIR set correctly - from then on worked perfectly.
eshanne November 13, 2009
hii nice script but i have a problem here.. i still can't make it done.. can you help me please..

please check this for me..
http://www.trueone2u.com/download.php?f=download.zip

i tried so many times but i still can't make it done.. hope you can help me ..

i put my download.php at the /download/ folder..

eshanne.
renukar41 [anti-spam] gmail.com November 18, 2009
its giving error
Sx4 November 18, 2009
thanks. It works
mukul November 24, 2009
i works nice but anyone can download by giving direct link.i want that file should not download by pasting the link.
what can i do?
Abhay November 25, 2009
I tried to implement ur php scripts in my project, but it doesn't work.So, i have one question for u does ur script work on Zend Framework, coz my project is based on Zend Framework
cyclops4real [anti-spam] yahoo.com November 25, 2009
it works on local server xampp but when i uploaded to my webserver it doesnt work yet it php supported
Brad November 26, 2009
This is a great little program, thank you - exactly what I was after (something better for a web site than plonking in a href and leaving instructions to 'right click and save link'.

I was terrifically muddled - don't laugh - though when I thought the program was corrupting the files it was copying. I just couldn't work it out. The problem turned out to be my having various files of the same name in nested subdirectories ... and your find_file() deliberately looks in sub-directories for the named file?!?!?! Crazy. But after figuring that out it was all plain sailing, and a great widget to use.
balamuralimu [anti-spam] gmail.com November 27, 2009
i have some txt files in the folder and i need to add the files in to zip, i need the script for that
cyclops4real [anti-spam] yahoo.com November 28, 2009
its working on server but cut shut to 90 kb always
SISTEMCREATORS.COM November 29, 2009
THANKS VERY NICE SCRIPT
Eric December 2, 2009
Great script, although I'm having this same problem with zip files arriving corrupt, can anyone shed any light on that situation?
December 2, 2009
I had used your code but while working on linux server after downloading the file the file has currupt....
Manish December 3, 2009
awesome...

Thanx for such a beatiful script
jimmy December 6, 2009
Excellent script. Thanks for sharing with us!
junfublog.blogspot.com December 6, 2009
it works, thanks for your script.
nature_junejo [anti-spam] yahoo.com December 7, 2009
sir im also php developer i wana work with your group and want to join ur group
andyramdani [anti-spam] gmail.com December 8, 2009
Wow it's works dude!!!...Thx...beautiful and clean script...thx for share...waiting for ur next awesome script...^^v

Regards
Andi - Jakarta, Indonesia
December 8, 2009
How can we Download files like html and php dude? The thing is they open in browser.. And we dont get the save or open dialog box?
Download files like html and php December 8, 2009
set content type to "application/octet-stream" - it will open download dialog
n3w5.l3773r [anti-spam] /////no\\//spam\\\\virgin.net December 12, 2009
Works fabulously. One tip if you are having problems is to check and correctly set the permissions on the folders and log_file on the server.
sekarbright [anti-spam] gmail.com December 18, 2009
Really nice and simple to use...
Works good...
December 19, 2009
Nice script. I modified to suit my need. You can see it here and can download newest english movies:
http://easydownload.orgfree.com/
dhilipsporty [anti-spam] gmail.com December 21, 2009
hi
i am new webie somebody tell me full tutorial
December 23, 2009
It says
"Sorry, Internal Server Error"

when i put file size above 8mb.
How do i increase the download file size limit ?
suresh December 28, 2009
I get this error.

File does not exist. Make sure you specified correct file name.

define('BASE_DIR','/opt/lampp/htdocs/download/');

this is the place i have download.php file. and the download files are in

/opt/lampp/htdocs/files/

now how should i give the path
jtootl [anti-spam] gmail.com December 29, 2009
hi
All works fine, except the zip/rar files when you download and Extracting them they say they are corrupted
why?
Vasanth07 December 29, 2009
How to Create Normal Download Page In HTML.(Files,Videos,Software,and some Files)
Rod January 1, 2010
Excelent, easy to setup and it works beautifully
polysync1 [anti-spam] googlemail.com January 6, 2010
hi there need some help,
What would be my BASE_DIR location if my files that i want downloading are stored in C:\xampp\htdocs\Dub\Uploads.?

ranjandeo [anti-spam] gmail.com January 10, 2010
Amazing !!!!!!!!!
Really great.
It is working perfectly as i needed.
Thanks a lot.
Mr.AnOiR January 10, 2010
Hello Guys ! It's really a cool script from you Zurbag! i was told how can i add and include date, file name, time of downloads,and that stiffs which you said in description of this script please help me to include that stuff on it and tell me how i will do that :) and thanx a lot for understanding me
Dave January 10, 2010
This script is awesome, I found a great host too: http://www.pacifichost.com you guys should check em out
j.weisberg [anti-spam] yahoo.com January 12, 2010
Has Anyone noticed any issues with this script functioning on ie 8?
bestarabic [anti-spam] sogetthis.com January 18, 2010
Thanx, I will try to add it on http://www.bestarabic.com
mflood [anti-spam] revolutionworld.com January 21, 2010
This just ends up downlaoding the php file itself. Any ideas?
January 24, 2010
I need a script for viewing images from other site in my page with hiding source, can &#305; use this script for it
http://www.notalar.1harika.com
James January 24, 2010
Excellent script works extremely well.. Just one question is there a possible way to add a login side to it in other words user has to enter username and password to download the file
protect download January 25, 2010
This forum post describes how to protect http://www.zubrag.com/forum/index.php/topic,182.0.html
You'll need http://www.zubrag.com/scripts/password-protect.php script for login/password prompt
bklyn2cali [anti-spam] gmail.com January 25, 2010
okay. i've read EVERY single post to this forum and i too am having problems with the install and use of this script.

I have files (on my site) that are stored in this manner:
http://www.website.com/user/player/download

i've set the define('BASE_DIR','download/');

(and i even tried putting user/download/)

on the page where i want to download, i have:
player/download/download.php?f=song.mp3

what am i doing incorrect?

i've tried about every combination (from others replies and suggestions on the board) and i'm having NO luck.

help please!
thank you.
pediatek February 2, 2010
I try to add it on
http://www.pediatek.com
but the browser shows 'Internal server error. Please contact system administrator.'
February 6, 2010
Awesome script! Works like a charm!

Thank you!

Add Comment

!!! Comments posted here will not be answered. If you want to ask a question please post it on the forum.

E-mail or Name: Not required. Email will be protected from spammers

Comment: Please do not post unrelated comments

Anti-spam: Please enter (d071c3c2) into the box