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
Tell me what is needed to be able to use image function?
for image work which library?
Where is session value stored php?
Describe PHP error and logging information?
How to remove a file?
Is php a programming language?
What are session variables in php?
Is php still relevant 2019?
Is php easier than node?
How can cross site request forgery csrf be prevented?
How to retrieve the original query string?
What does $_env mean?
Why would we use === instead of ==?
Do you know what does $globals means?
What are php keywords?