Re: upload issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nihilism machine wrote:
any idea why this fails?this is the error: "Sorry, there was a problem uploading your file"

It can't move the file to the $target location, or maybe the file wasn't uploaded properly in the first place.

What's in $_FILES['uploaded']['error'] ?

http://www.php.net/manual/en/features.file-upload.errors.php

if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
    // Error
    echo "File was uploaded!";
} else {
    echo "Sorry, there was a problem uploading your file.";
}

chmod($target, 0755);

Files do not need to be 0755, they should be 0644 unless you want them to actually run something (eg they are a shell script or perl script that you'd run from the cmd line).

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux