#1
  1. No Profile Picture
    skunkel
    Guest
    Devshed Newbie (0 - 499 posts)
    Hello all,

    I can't get the fileupload to work and I have no further idea.

    my form looks like the standard example:


    <form enctype="multipart/form-data" action="upload2_2.php3" method=POST>
    <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
    Filename:
    <input name="userfile" type="file">

    <input type="submit" value=" Send File ">
    </form>

    and in upload2_2 the variable $userfile has the value /temp/phpxxxxxxx.

    the upload2_2.php3 site looks like this:


    <?
    print"$userfile";
    print"$userfile_name";
    print"$userfile_size";
    print"$userfile_type";
    $dest="tmp/test.jpg";
    copy($userfile, $dest);

    ?>

    so far seems everything o.k. But I get the following Error:

    Warning: SAFE MODE Restriction in effect. The script whose uid is 501 is not
    allowed to access /tmp/php00508baa owned by uid 0 in
    /usr/local/httpd/htdocs/bisoag/album/upload2_2.php3 on line 8

    How can I solve this ? Im running apache on linux (SuSE 6.1) and the /temp
    directory has 777 rights.


    please help :-(


    best regards
    Sascha

    eMail: skunkel@bisoag.de


  2. #2
  3. No Profile Picture
    esconsult1
    Guest
    Devshed Newbie (0 - 499 posts)
    I had some crappy problem like that too.
    Make sure the the ownerships on the tmp directory is the same as that run by the web server.

    If that does not work, edit your php.ini file and select your own tmp directory!
  4. #3
  5. No Profile Picture
    Paul Cotton
    Guest
    Devshed Newbie (0 - 499 posts)
    I had problems, mine were down to disk quota for the user 'web'.

    Why is your setup running SAFE MODE though, I think that may be the problem as I think I read somewhere there are limitations when in this mode.
  6. #4
  7. No Profile Picture
    lacey
    Guest
    Devshed Newbie (0 - 499 posts)
    You can easily switch out of safe mode by editing your php.ini. Also, I doubt it makes any difference, but I use the line:

    exec("cp $userfile /home/$usr/public_html/$userfile_name");

    to save the file.

Similar Threads

  1. File Upload with older PHP 4.06 and $HTTP_FILES_VARS
    By jtp51 in forum PHP Development
    Replies: 1
    Last Post: February 16th, 2004, 05:25 PM
  2. Replies: 1
    Last Post: February 8th, 2004, 02:59 PM
  3. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 08:42 PM
  4. Simple find and replace word search for a text file with php?
    By rabid lemming in forum PHP Development
    Replies: 4
    Last Post: February 1st, 2004, 10:37 PM
  5. php-sql file upload and download
    By mthroesch in forum PHP Development
    Replies: 0
    Last Post: January 28th, 2004, 02:56 AM

IMN logo majestic logo threadwatch logo seochat tools logo