Jump to content

Files upload most of the time, but not always


Nolongerused3921

Recommended Posts

I'm having an incredibly strange bug that seems to appear both on my personal server (XP, PHP 5.0, MySQL 4.1) and my other server (Redhat ent 3, PHP 5.0, MySQL 4.1)... For some reason, [b]sometimes[/b] when you upload a file, it doesn't move it to the new folder... It sees [b]all[/b] of the data, adds said data to a database, but doesn't move it.

Now the strange thing about this is, that, well... It doesn't always do it, and if it does it to a file one time, the next time you upload it - it works fine.

The code:
[code=php:0]
        $new_filename = $exact_dir.$upload_location . $id . "_" . basename($fileName);
        if (!move_uploaded_file($tmpName,$new_filename)) {
            echo "Failed...";
print_r($_FILES);
            return;
        }
[/code]
$exact_dir, $upload_location, and $id are all correct... This moves it to the [b]exact[/b] location (As in, from the server's root down to the folder name) and filename is just $_FILES['file']['tmp_name'].

I would really like to know why this doesn't work... All the data is being seen (And added to a database), its not printing "Failed...", and I'm not getting any warnings... What could be causing this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.