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
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?
Which will start a session?
How do you pass a variable by value in php?
What is input sanitization in php?
How check submit button is clicked in php?
What are the differences between GET and POST methods in form submitting?
How to call javascript function in php on button click?
How to do single and multi line comment in php?
Tell me what are the correct and the most two common way to start and finish a php block of code?
What is abstract class php?
What is null value in php?
can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.
What is the latest version of php?
Explain PHP?
Is server side a session?