Answer Posted / vishwapati_mishra
<?
$dir="/path/to/file/";
if (isset($_REQUEST["file"])) {
$file=$dir.$_REQUEST["file"];
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment;
filename=\"".basename($file)."\"");
readfile("$file");
} else {
echo "No file selected";
}
?>
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
A process can run only in the background. State Whether True or False?
What is the correct and the most two common way to start and finish a php block of code?
What is a controller php?
What is mysqli_fetch_array?
What is the string concatenation operator in php?
what does this symbol mean in php?
How to store the uploaded file to the final location?
What are new features in php 7?
How to merge values of two arrays into a single array?
What is the best php framework 2018?
Do you know how can we check the value of a given variable is a number?
What is a string in r?
How can we check the value of a given variable is a number?
Tell me what kind of things have you done on the social side?
How can I learn php fast?