Connecting Tech Pros Worldwide Help | Site Map

Force File Download on Page Load

Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#1: Aug 22 '09
I'm wondering if its possible to force a file to be downloaded when you go to a certain page. Say if you click on the link for the page and then it will go to that page and give you the prompt box to save or download the file?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Aug 22 '09

re: Force File Download on Page Load


see this thread.

.........
Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#3: Aug 22 '09

re: Force File Download on Page Load


Ok, I'm getting this error in the file when I download it?

Quote:
<br />
<b>Warning</b>: readfile(../media/resources/7.4.Test-1-Word-File.doc) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: No such file or directory in <b>C:\web-folders\htdocs-ipi\download.php</b> on line <b>4</b><br />
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: Aug 22 '09

re: Force File Download on Page Load


try to use the absolute path of the file.
Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#5: Aug 22 '09

re: Force File Download on Page Load


Nope, the absolute path didn't work either! :S
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#6: Aug 22 '09

re: Force File Download on Page Load


You positive the file exists?
Familiar Sight
 
Join Date: Sep 2008
Posts: 252
#7: Aug 24 '09

re: Force File Download on Page Load


Found the problem, the link being passed to the download page was not formated correctly which was why the page was coming up with the error, thanks for your help.
Reply