1,105,625 Community Members

Download Not Load

Member Avatar
joshl_1995
Posting Whiz in Training
281 posts since Jul 2012
Reputation Points: 3 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 4 [?]
 
0
 

Hello Community,
I was wondering if there is a way to goto the direct link of a file (eg. http://example.com/files/test.txt) and for it to download insted of loading and displaying the file.
I want to do this for every file in the "files" folder and only that folder.

Member Avatar
OsaMasw
Posting Whiz in Training
212 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

after searching I found this

header("Content-Disposition: attachment; filename=\"" . basename($File) . "\"");
header("Content-Type: application/force-download");
header("Content-Length: " . filesize($File));
header("Connection: close");

HERE

Member Avatar
joshl_1995
Posting Whiz in Training
281 posts since Jul 2012
Reputation Points: 3 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 4 [?]
 
0
 

What do i add this to?

Question Answered as of 1 Year Ago by OsaMasw
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: