문제

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