Page 1 of 1

Not finding uploaded tmp file in upload directory

Posted: Thu Feb 16, 2012 4:27 pm
by edziffel
Am using <form enctptype='multipart/form-data"... as follows:

Code: Select all

    <form enctype="multipart/form-data" name="selectloaddatafileform" action="inldif2.php" method="post">
       <label>Select file to upload in database table ship</label>   
       <input type="file" size="60" name="filetoinsert" />
       <input type="hidden" name="dbselected" value="<?php echo $dbselected;?>" />
       <input type="submit" value="submit" />   
       </form>

On page inldif2.php I get:

Code: Select all

    this is the print r of $ FILES: Array ( [filetoinsert] => Array ( [name] => mytestfort2.csv [type] => text/csv [tmp_name] => /tmp/phpVZvBJw [error] => 0 [size] => 54 ) )
    this is the var dump of $ FILES array(1) { ["filetoinsert"]=> array(5) { ["name"]=> string(15) "mytestfort2.csv" ["type"]=> string(8) "text/csv" ["tmp_name"]=> string(14) "/tmp/phpVZvBJw" ["error"]=> int(0) ["size"]=> int(54) } } 
which is just what was expected.

My upload directory has been set to /tmp, using Ubuntu 10.04 lts.
Running phpinfo() I get

Code: Select all

    upload_tmp_dir   /tmp   /tmp
for local value and master value respectively.

However, after uploading the file from the page where the form is which posts to the page where the print_r and var_dump is parced, I am not seeing the file phpVZvBjw (the temp version as called in the print_r and var_dump) in /tmp. Shouldn't I be able to see the tmp file in the tmp directory?

Re: Not finding uploaded tmp file in upload directory

Posted: Thu Feb 16, 2012 6:42 pm
by Celauran
Best I can tell, this is normal behaviour. Any reason you aren't moving the uploaded file into your site's directory tree?