I have written the following code. Nothing is written in the web browser and no error is thrown. Can anyone please help me to identify the problem?
try {
echo file_get_contents($_FILES["image"]["tmp_name"]);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
Here is the form:
echo "<form action='upload.php' method='post' enctype='multipart/form-data'>
<p><input type='file' name='myfile'/></p>
<p><input type='submit' value='Upload'/></p>
</form>";
The thing was that I was following a tutorial where I was supposed to set: $image=file_get_contents($_FILES["image"]["tmp_name"]); When the person in the tutorial tried to echo it the files content was written in the browser. Nothing happened for me. I assume it is not working.