question about file transfer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saqqa
Forum Newbie
Posts: 3
Joined: Thu Jun 22, 2006 10:35 am

question about file transfer

Post by saqqa »

Hi every one and thanks for yr help and support on advance

Well, I have a problem with file transfer( browse and upload files).
At my Web space all ok and works perfectly
See this link plz http://khaals5.100webspace.net/upload.php

But if I use the same code on my company web space I got this error

Warning: copy() [function.copy]: open_basedir restriction in effect. File(/tmp/phpuPlPPU) is not within the allowed path(s): (/home/customers/webs/rmaus/) in /home/customers/webs/rmaus/upload.php on line 48
Unknown error
!

Check this link plz http://www.rmaus.com.au/uploader.php

Basically I use this simple copy command

Code: Select all

copy($HTTP_POST_FILES["filename"]["tmp_name"], "./".$_FILES["filename"]["name"]) ;
I’m waiting yr great advice.
Thanks again
User avatar
evilchris2003
Forum Contributor
Posts: 106
Joined: Sun Nov 12, 2006 6:43 am
Location: Derby, UK

Post by evilchris2003 »

Try reading this

http://www.photopost.com/forum/showthread.php?t=128519

all i did was google the error message you will usually find someone else has had the same problem
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Why are you mixing $HTTP_POST_FILES and $_FILES? Try using move_uploaded_files() to bypass safemode restrictions.

Code: Select all

move_uploaded_file($_FILES["filename"]["tmp_name"], "./".$_FILES["filename"]["name"]) ;
saqqa
Forum Newbie
Posts: 3
Joined: Thu Jun 22, 2006 10:35 am

thanks

Post by saqqa »

Thanks all, i ganatry it...

Regards
Post Reply