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 is variable scope, which variables are accessible from where and what are "undefined variable" errors?
What does type casting mean in php? Explain with an example?
What are session variables in php?
How many different types of messages available in php?
Is key in array php?
Does php 7 support multiple inheritance?
Tell me can you extend a final defined class?
Where to put php files in apache server?
What is the use of mysqli_real_escape_string() function?
How is php different from other languages?
What is the use of header() function in PHP? What the Limitation of HEADER()?
How to get best php developer Experience in Php with Sugar CRM / VTiger.
What is split function in php?
Does php have multiple inheritance?
What is the use of strpos in php?