DeveloperSide.NET Forums

DeveloperSide.NET => Anything else goes here => Topic started by: portland on March 27, 2007, 02:40:33 PM

Title: strange upload error
Post by: portland on March 27, 2007, 02:40:33 PM
When I upload a file (eg f00.jpg), and execute move_uploded file, it is moved to Apache\f00.jpg and NOT to the specified dir.

When I upload the same file again, it DOES move the file to the right directory.

In both cases move_uploaded_file returns 'true'.

It looks like the file is only placed in the proper directory when no fo file of that name exists in Apache\ (I tried that).

Looks like a bug.  Or?

   <form action="" method="POST" enctype="multipart/form-data">
   <input class="b" name="upload" type="file" size="40">&nbsp;&nbsp;
   <input class="b" type="submit" value="Upload">

and on upload:

   case $_FILES['upload']['name']=='':
      echo 'No file for upload!';
      return false;

       echo 'Move OK: '.$path.$fileSaveName; // debug
         return $fileSaveName;
       echo 'Move BAD'.$path.$fileSaveName; // debug
         return false;