if an image is posted to a php script but the php script isn't expecting an image to be posted to it, what happens to the posted image? does it still go into the /tmp folder on the server?

example:

<form action="myscript.php" enctype="multipart/form-data" method="post">
<p>
Type some text (if you like):<br>
<input type="text" name="textline" size="30">
</p>
<p>
Please specify a file, or a set of files:<br>
<input type="file" name="datafile" size="40">
</p>
<div>
<input type="submit" value="Send">
</div>
</form>

my script:

<?php
phpinfo();
?>
有帮助吗?

解决方案

Yes, it still gets into the /tmp directory, but it gets deleted when the script finishes executing.

其他提示

whatever you posted through form will go to the server

Yes!

it will be uploaded to upload_tmp_dir defined in php.ini file.

it will deleted once your php file finish execution.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top