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.

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 (9134f061) into the box