CANNOT UPLOAD FILES
Moderator: General Moderators
CANNOT UPLOAD FILES
I've had this PHP app running on my server (windows server 2003 for small business, PHP Version 5.1.2) for more that 1 year but one of the options just stopped working last week. I was able to upload files with no problem but not now. I have not changed configuration files lately but it just won't work.
I already checked php.ini and it seems to be ok (post_max_size = 1024M, upload_max_filesize = 1024M, file_uploads = On), file permissions are ok too. Im getting error_code 7 when I print the array $_FILES (UPLOAD_ERR_CANT_WRITE).
I've been reading and searching for this error for 1 week with no luck.
Any ideas?
Thanks
I already checked php.ini and it seems to be ok (post_max_size = 1024M, upload_max_filesize = 1024M, file_uploads = On), file permissions are ok too. Im getting error_code 7 when I print the array $_FILES (UPLOAD_ERR_CANT_WRITE).
I've been reading and searching for this error for 1 week with no luck.
Any ideas?
Thanks
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
-
jeffery
- Forum Contributor
- Posts: 105
- Joined: Mon Apr 03, 2006 3:13 am
- Location: Melbourne, Australia
- Contact:
have you by chance declared an input field with a MAX_FILE_SIZE in it ?
Code: Select all
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />When you upload file it is first uploaded to temp directory (e.g. /tmp) and after that you have to move it to your destination directory. I wonder whether your temp directory (i.e. disk/partition containing it) has run out of space...sxgomezf wrote:Yes, I defined a new folder to upload the files. Permissions are ok and the partition where the folder is located has 80GB of free space. Im running out of ideas....
Try echoing $_FILES['file_input_name']['tmp_name'] and see where temporary files are put.
There are 10 types of people in this world, those who understand binary and those who don't
The hidden field was declared and MAX_FILE_SIZE set to 1024000.
When echoing $_FILES this is what I get:
Array ( [file] => Array ( [name] => Test.xls [type] => [tmp_name] => [error] => 7 [size] => 0 ) )
Nothing!
The first thing I checked when I got the line above was the temp folder. Both, the temporary and the destination folder have enough space. Permissions are also ok.
When echoing $_FILES this is what I get:
Array ( [file] => Array ( [name] => Test.xls [type] => [tmp_name] => [error] => 7 [size] => 0 ) )
Nothing!
The first thing I checked when I got the line above was the temp folder. Both, the temporary and the destination folder have enough space. Permissions are also ok.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I don't think permissions are okay. Run this in a new file:
Code: Select all
<?php
$s = ini_get('session.save_path');
if(!file_exists($s))
{
echo var_export($s,true), ' doesn\'t exist!';
exit;
}
$p = (is_dir($s) ? 'd' : '-');
$p .= (is_readable($s) ? 'r' : '-');
$p .= (is_writable($s) ? 'w' : '-');
$p .= (is_executable($s) ? 'x' : '-');
echo var_export($s, true), ' is ', $p;