Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

download file using jquery php

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$_REQUEST['f']);
readfile('../some_folder/some_subfolder/'.$_REQUEST['f']); 
exit;

//You open this php-file via 
window.location.href = 'scripts/this_php_file.php?f=downloaded_file';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #download #file #jquery #php
ADD COMMENT
Topic
Name
8+9 =