Answer Posted / rashmi
On HTML:
<form enctype="multipart/form-data" action="uploader.php"
method="POST">
<input name="uploadedfile" type="file" />
<input type="submit" value="Upload File" />
</form>
On PHP script:
<?php
$data="any_file.Ext";
$ft=filetype($data);
header('content-type: application/$ft');
header('content-length:'filesize($data));
header('content-disposition:filename='.$data);
echo file_get_contents($data);
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What difference between require() and require_once()?
Are php sessions secure?
What is difference between python and php?
What does the unlink() function mean?
What is the best way to avoid email sent through php getting into the spam folder?
How to specify argument default values?
Explain what is the difference between $var and $$var?
What is difference between strstr() and stristr() in PHP?
What is string function sql?
Is overloading possible in php?
What is the use of session and cookies in php?
What is the difference between query and inquiry?
Tell me how is it possible to remove escape characters from a string?
Is php session id unique?
A process can run only in the background. State Whether True or False?