move_uploaded_file returns false

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

Threaded View
Please help in the following problem:
I have written a PHP5 script uploading file:

    isset($_POST['EditionFile']) && isset($_POST['Year']) &&
        if (is_uploaded_file($_FILES['SelectEditionFile']['tmp_name']))
                // Load file:
                $file = $_FILES['SelectEditionFile']['name'];
                $ext = @substr($file,
                               @strrpos($file, '.') ? @strrpos($file, '.') + 1 :
                $paper = 'Paper/Blask_' . $_POST['Year'] . '-' . $_POST['Month']
. '.' .
(!move_uploaded_file($_FILES['SelectEditionFile']['tmp_name'], $paper))
                        $_SESSION['Error'] = 'Cannot move file.';

The problem is that 'Cannot move file' is reached during execution of the
script. I don't know why. I have checked priviledges on $paper folder: it
looks OK.
Will you help me?

Re: move_uploaded_file returns false


Quoted text here. Click to load it

Quoted text here. Click to load it

What are the priviledges, and what does realpath($paper); tell you about=

the directory?
-- =

Rik Wasmus

Re: move_uploaded_file returns false

Rik Wasmus wrote:
Quoted text here. Click to load it

The priviledges are rwxrwxr-x.
echo realpath($paper) prints nothing, so $papaer is null or empty, I think.
The problem was not occuring so far.

Site Timeline