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 meant by ‘passing the variable by value and reference' in php?
Is salary a ratio or interval?
What is data type in php?
What is csrf token and how will you add csrf token in ajax?
Explain Constant in Class?
What is the content of /etc directory?
i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..
What are different types of errors available in Php?
Is it difficult to learn php?
How can we submit from without a submit button?
What is move_uploaded_file in php?
Can you extend a final defined class?
What is static in php?
What is the difference between characters 23 and x23?
How do you check if an arraylist is empty?