Welcome, Guest
  • Author Topic: PHP Upload problem  (Read 2496 times)

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    PHP Upload problem
    « on: 10/17/07, 09:37 »
    I have been trying to get the Flash Upload script to work on our server with no luck.  I was first getting a 403 error, then I read to add some entrys to a .htaccess file in the dir so that the safe mode stuff was handled.  (or something like that)

    The flash page actually says that the file was uploaded and tries to download into the player, but there was never a file uploaded or at least moved to the FILES directory.  can anyone help with what might be some issues to look at.  I am very novice with PHP, and am on a shared hosting server, so don't have too much access to the php configuration, although I can find out what settings are set to.  Thanks so much.

    By the way the Flash PHP Upload stuff was found here: http://www.flash-db.com/Tutorials/upload/

    And the two entries I made to a .htaccess file were:
    SecFilterEngine Off
    SecFilterScanPOST Off

    These two got me past the 403 error I was getting originally, if that helps.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: PHP Upload problem
    « Reply #1 on: 10/17/07, 09:56 »
    Also be sure that the folder have read/write permissons

    Jorge

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    Re: PHP Upload problem
    « Reply #2 on: 10/17/07, 10:13 »
    Indeed!  I do have the proper assignments.  I have tried a couple of different settings 755 777 none help.

    Any other thoughts?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: PHP Upload problem
    « Reply #3 on: 10/17/07, 10:43 »
    Check your server logs, probably you have a more detailed error

    Jorge

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    Re: PHP Upload problem
    « Reply #4 on: 10/17/07, 10:51 »
    Your correct, there is a little more information in the logs.  Here is what I found:

    [Wed Oct 17 08:40:40 2007] [error] [client 68.99.72.11] File does not exist: /home/praycele/public_html/upload/files/afghanistan.gif

    It appears that the file may be getting uploaded, but not moved to the appropriate place.....is that possible?

    What kind of path issues should I look for?  Thanks again.

    The default paths were ./files in the php file, as shown in the tutorial post, see above.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: PHP Upload problem
    « Reply #5 on: 10/17/07, 11:48 »
    Is php running safe_mode?

    Jorge

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    Re: PHP Upload problem
    « Reply #6 on: 10/17/07, 12:22 »
    I just looked and

    safe_mode is OFF 

    I can supply other settings if it would help.

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    Re: PHP Upload problem
    « Reply #7 on: 10/17/07, 16:06 »
    I tried using a generic PHP only script that uses the same command and I am getting a little more information for debug...see below:

    Warning:  move_uploaded_file(/home/praycele/public_html/upload/files/albania.gif): failed to open stream: Permission denied in /home/praycele/public_html/upload/testupload.php on line 7

    Warning:  move_uploaded_file(): Unable to move '/var/tmp/phpktQTn4' to '/home/praycele/public_html/upload/files/albania.gif' in /home/praycele/public_html/upload/testupload.php on line 7
    Possible file upload attack! Here's some debugging info:

    Array
    (
        [userfile] => Array
            (
                [name] => albania.gif
                [type] => image/gif
                [tmp_name] => /var/tmp/phpktQTn4
                [error] => 0
                [size] => 2439
            )

    )


    Anyone help?  Thanks for any input or guidnace!

    tcoursey

    • Server what's that
    • *
    • Posts: 9
      • View Profile
    Re: PHP Upload problem
    « Reply #8 on: 10/17/07, 16:21 »
    GOT IT!  the directory HAS to be set to 777 not 755 or 775.

    Easy fix.  wow.  I wonder if that is something to do with my php config, or generic.....the script talks about 755 too...hum.

    Oh well. thanks for all the help.