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.

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

What do i add this to?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.