56 users online (1 members and 55 guests)  


  Results 1 to 5 of 5

Related

  1. PHP Upload script error    Forum: PHP Forum
    Replies: 14
  2. Upload Script    Forum: PHP Forum
    Replies: 1
  3. [split] PHP upload script.    Forum: PHP Forum
    Replies: 3
  4. php upload script needed..    Forum: PHP Forum
    Replies: 5
  5. Script to allow users to upload pics    Forum: Website Scripts Forum
    Replies: 2
  1. #1
    defekt's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2003
    Posts
    3

    PHP upload script.

    Ok, I have a bit of a problem. I have a file named addimage.php in a directory, and it is supposed to upload files to /gallery/img in the same directory.

    http://ptk.grawkin.com/addimage.php

    I get this error.

    Warning: copy(): open_basedir restriction in effect. File(/ptk/gallery/img/andrea.jpg) is not within the allowed path(s): (/home/grawkin:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/grawkin/public_html/ptk/addimage.php on line 56

    Warning: copy(/ptk/gallery/img/andrea.jpg): failed to open stream: Operation not permitted in /home/grawkin/public_html/ptk/addimage.php on line 56
    Last edited by HTML; 01-04-2004 at 11:17 PM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi there, welcome to the forums.

    It sounds like php is running in safe-mode. Try chmodding the directory to 777 just in case. If that doesn't work, put

    <? phpinfo(); ?>
    in a file, view it, and see if safe-mode is on.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    defekt's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2003
    Posts
    3
    Safe mode is off... http://grawkin.com/ass.php

    Still can't get the **** to work.


    <admin>Please refrain from swearing</admin>
    Last edited by QuietDean; 12-29-2003 at 01:39 PM.

  4. #4
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    Quote Originally Posted by defekt
    Safe mode is off... http://grawkin.com/ass.php

    Still can't get the **** to work.
    That's a PHP permissions error... You shouldn't be using copy() in the first place!

    http://www.php.net/manual/en/features.file-upload.php
    http://www.php.net/manual/en/function.move-uploaded-file.php

    Look at those, they give a ton of information. The PHP manual has to be by far one of the best documentations that I have ever used!

    Also, make sure you are using FULL PATHS... one thing you can do, if the folder is in the same level as the script.. ie.

    PHP Code:
    // dir looks like so:
    // addimage.php
    // upload

    $MoveImageHere dirname__FILE__ ) . '/upload/'
    Hope that helps!
    if it does, don't forget the karma!

    -Eric

  5. #5
    defekt's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2003
    Posts
    3
    Thank you! I will try this later!



Tags for this Thread