problem with moving uploaded files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Jiao

    #1

    problem with moving uploaded files

    Hi all

    I am having a little trouble uploading files (html form with post) with
    php...

    I am trying to copy the file from its temporary upload directory to the
    destination directory, however, the server threw this msg at me... what does
    it mean? and how do I circumvent it?


    $user_file_tmp_ name = /tmp/phpTeA9Hs
    $dest_name = /home/free3/user_product_im ages/jamesjiao/Alizee18.jpg

    Warning: copy(): open_basedir restriction in effect. File(/tmp/phpTeA9Hs) is
    not within the allowed path(s): (/home/free3) in
    /home/free3/my-page-admin.php on line 91

    I tried both the copy() function and the move_uploaded_f ile() function and
    got the same warning.

    ==james==


  • James Jiao

    #2
    Re: problem with moving uploaded files

    Thanks for the tip.. it's working now. (i think why it didn't work before
    was because i passed in a dir instead of a file for the second argument in
    move_uploaded_f ile())

    ==James==

    "Martin C. Petersen" <mcp@phys.au.dk > wrote in message
    news:3f4df38f$0 $83064$edfadb0f @dtext01.news.t ele.dk...[color=blue][color=green]
    > > I am trying to copy the file from its temporary upload directory to the
    > > destination directory, however, the server threw this msg at me... what[/color]
    > does[color=green]
    > > it mean? and how do I circumvent it?
    > >
    > >
    > > $user_file_tmp_ name = /tmp/phpTeA9Hs
    > > $dest_name = /home/free3/user_product_im ages/jamesjiao/Alizee18.jpg
    > >
    > > Warning: copy(): open_basedir restriction in effect.[/color][/color]
    File(/tmp/phpTeA9Hs)[color=blue]
    > is[color=green]
    > > not within the allowed path(s): (/home/free3) in
    > > /home/free3/my-page-admin.php on line 91
    > >
    > > I tried both the copy() function and the move_uploaded_f ile() function[/color][/color]
    and[color=blue][color=green]
    > > got the same warning.[/color]
    > You should certainly use move_uploaded_f ile() - what warning does it give
    > you?
    >
    >
    > Martin
    >
    >[/color]


    Comment

    Working...