Page 1 of 1

Strange Upload

Posted: Fri Jul 31, 2009 8:38 am
by Addos
Just wondering if anybody has seen this before. I have a folder on the server that stores images to be added to a queue of emails that I'm sending out. This works perfectly for me when I physically drag and drop an image (.jpg) into the folder using CS3 FTP but when I use a simple file upload script then the attachment doesn't get sent.

I can clearly see that the file has been uploaded to the folder using the PHP script as I can see it in the folder and I'm very puzzled as to why the FTP one is recognized but the File Upload one isn't. I can't see any difference and have used the exact same file for FTP and the upload script and it makes no difference. It's like the Upload PHP file is something
different by the time it's uploaded yet if I type a path to this folder I can browse all the images perfectly.

Anyone seen this before?

This is the PHP upload script that I use regularly and it's never given a
problem.

Code: Select all

if ($_FILES['fupload']['type'] == "image/jpeg") {
 
            $source = $_FILES['fupload']['tmp_name'];
            $target = "folder_1/folder_2/" .$_FILES['fupload']['name'];
            /* strip htlm tags white and make lowercase. */
             $clean = strip_tags(trim(strtolower($target)));
           //strip any spaces
           $clean= str_replace(' ' , '_' , $clean);
          move_uploaded_file( $source, $clean ); // or die ("couldn't copy");
        echo '<br><strong> File'. $clean . ' ' . 'was successfully Uploaded.</strong>';
       }

Re: Strange Upload

Posted: Fri Jul 31, 2009 8:43 am
by VladSun
Sounds like a permissions/owner issue.

Re: Strange Upload

Posted: Fri Jul 31, 2009 8:51 am
by Addos
Sounds like a permissions/owner issue.
Thanks for the fast reply. I have heard about this but really have no idea where to look. I’m on a Linux server with access through DirectAdmin and after that I’m not really sure where to go from here. I can set directory permissions and have done so 777 so that I can upload files and I have used this before without any problems.

How do I go about seeing the permissions locally that I have and compare these with the ones on the server?

Thanks again

Re: Strange Upload

Posted: Fri Jul 31, 2009 9:03 am
by VladSun
Go to Files seciotn in DirectAdmin and compare them :)

Re: Strange Upload

Posted: Fri Jul 31, 2009 4:59 pm
by aceconcepts
Did you create the directory manually?

If so, try creating the directory by code.