We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,650 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Download Not Load

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.

2
Contributors
2
Replies
3 Hours
Discussion Span
4 Months Ago
Last Updated
5
Views
Question
Answered
joshl_1995
Junior Poster
157 posts since Jul 2012
Reputation Points: 3
Solved Threads: 2
Skill Endorsements: 1

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

OsaMasw
Junior Poster
161 posts since Jan 2012
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

What do i add this to?

joshl_1995
Junior Poster
157 posts since Jul 2012
Reputation Points: 3
Solved Threads: 2
Skill Endorsements: 1
Question Answered as of 3 Months Ago by OsaMasw

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0573 seconds using 2.65MB