Home >>Advance PHP Tutorial >PHP Download File

PHP Download File

PHP File Downloading



       $file = ("myfolder/$f");



       header ("Content-Type: ".$filetype);

       header ("Content-Length: ".filesize($file));

       header ("Content-Disposition: attachment; filename=".$filename);



Suppose You have a directory inside with collection of multiple related Files . Display all stored files using opendir( ) and readdir( ) function. Download those particular file on which user has clicked.(It means download the files dynamically not a static file)

No Sidebar ads