Questions tagged [force-download]
116 questions
31
votes
2 answers
PHP create file for download without saving on server
Ultimate goal: I want to create a webpage where a user can enter information in forms. With that information I want to create a html file (below called test-download.html) by inserting the information given into a template and then force a download.…

Thomas
- 1,085
- 5
- 19
- 33
20
votes
4 answers
send zip file to browser / force direct download
i created with php zip ( http://php.net/manual/de/book.zip.php ) a zip file
now i have to send it to the browser / force a download for it.

Martin Huwa
- 401
- 3
- 7
- 11
19
votes
4 answers
Force Download an Image Using Javascript
I want to know if there is any way to make a script using Javascript/jQuery to download (open a download dialog) a image so the browser won't just show it.

Nathan Campos
- 28,769
- 59
- 194
- 300
17
votes
2 answers
force download using ZF2
I am trying to do force download using ZF2. Here is the snippet to my code
use Zend\Http\Request;
.....
public function downloadAction() {
$response = new Request();
$response->setHeaders(Request::fromString("Content-Type:…

noobie-php
- 6,817
- 15
- 54
- 101
9
votes
6 answers
How to force download of big files without using too much memory?
I'm trying to serve large zip files to users. When there are 2 concurrent connections, the server runs out of memory (RAM). I increased the amount of memory from 300MB to 4GB (Dreamhost VPS) and then it worked fine.
I need to allow a lot more than…

Leandro Alves
- 2,190
- 3
- 19
- 24
7
votes
2 answers
Chrome adds "-, attachment" to downloaded file
I use Symfony2 Framework and use the following code to export an xml file:
$response->setStatusCode(200);
$response->headers->set('Content-Type', 'application/xml');
$response->headers->set('Content-Description', 'Submissions…

Micha
- 523
- 10
- 26
7
votes
3 answers
Force Downloading a PDF file, corrupt file
I've got a problem that has risen many times on SO, but I can't seem to find the solution to mine! I'm trying to deliver a pdf file to the client without it opening in the browser, the file downloads but it is corrupt when I open it and is missing…

David C
- 664
- 1
- 8
- 21
6
votes
7 answers
Idiot-proof, cross-browser force download in PHP
I'm using forced download to download mostly zips and mp3s on site i did (http://pr1pad.kissyour.net) - to track downloads in google analytics, in database and to hide real download path:
It's this:
extending CI model
... - bunch of code
function…

Adam Kiss
- 11,811
- 9
- 48
- 81
6
votes
2 answers
How to force PDF to download beginner
Possible Duplicate:
How to force a pdf download automatically?
I've checked other forums, but I do not understand what they say. I've checked this link which people do seem to get the…

Daniel Ramirez-Escudero
- 3,877
- 13
- 43
- 80
5
votes
2 answers
Force download PDF file from URL in wordpress
In WordPress, how do I create a link to a file such as "file.pdf" and force it to download instead of opening the file in the browser?

rowmoin
- 698
- 2
- 8
- 17
5
votes
1 answer
Force download in Google Chrome Extension
I'm writing an Google Chrome extension that lets you download a backup file of your data. I want the user to be able to press a button and a "Save as" dialog box should open and they can save the file to their computer. Nothing appears to work and I…

Erik Rothoff
- 4,826
- 9
- 41
- 59
5
votes
1 answer
Force download with Swedish characters (åäö) filename
I use the following code and function to force download files and it works great if the file name is not holding Swedish characters like Å Ä Ö.
$file_id = $_GET['f'];
$sql = " SELECT * ".
" FROM attachment ".
" WHERE…

Jonas Willander
- 432
- 3
- 9
- 29
5
votes
2 answers
Force-downloading, from php file
I'm attempting to download a .mp4 file. (about 1.3GB size).
I'm using following:

Frederik Spang
- 3,379
- 1
- 25
- 43
3
votes
1 answer
Codeigniter: download file and redirect
I have a form on this page http://www.obsia.com/products/thassos_wonder_brochure/
On hitting submit, I want it start downloading the file and also get redirected to thank you page. But I can only get it either download the file or redirect or load…

strangeloops
- 1,484
- 2
- 11
- 14
3
votes
2 answers
force-download xlsx from ajax response not working
I have this little problem with downloading my xlsx-file.
I am sending my request for the file over jquery Ajax and on the backend the data is correctly collected and assembled to a xlsx-file. So now on its way back to the frontend i am setting all…

Jan Wedel
- 31
- 1
- 5