file upload not saving file

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
When I upload an image to the server I get the message:

Warning: Only -1 bytes were written, expected to write 547

The server phpinfo lists  :

file_uploads On
upload_max_filesize 2M
upload_tmp_dir /tmp
PHP Version 4.4.1

so I created a directory named tmp at the root of my "server space" and

gave it chmod 777, but still the same error occurs. This is the result
of print_r($_FILES['myfile']) :

Array ( [name] => 2.jpg [type] => [tmp_name] => [error] => 7 [size] =>
0 )

Error 7 in the PHP manual is :

Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.

Any ideas what is wrong?

Re: file upload not saving file

zorro wrote:
Quoted text here. Click to load it

Try using the full path name of /tmp.

I think php is trying to write to the tmp dir in the root directory of
the hard drive not the tmp dir in your home directory


Re: file upload not saving file

yup, it was a path thing during move_uploaded_file...

I had this:

$_SERVER["DOCUMENT_ROOT"] . APP_PATH . "pictures/" . $newname);

then removing $_SERVER["DOCUMENT_ROOT"] . APP_PATH got it working

Site Timeline