Help with copy()/uploading a file
| From: | James Johnson | Date: | Sun, 31 Aug 2003 01:12:27 +0000 |
| Subject: | Help with copy()/uploading a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161280@lists.php.net to get a copy of this message | ||
Hi,
I need some help with the copy() function in order to allow a user to upload
an image. The image will need to be in a folder that I can access it's URL
for display in a page.
The hosting company, www.dreamhost.com, isn't too helpful with my requests
for help.
I have the following code:
$webServer ="/home/campuscb/ftp.campuscorkboard.com/adimages/";
$destFile = $webServer;
$destFile .= $img1_name;
if($img1_name!=""){
copy("$img1","$destFile") or die("Couldn't copy the file");
}
else{
die("No input file specified!$img1_name");
}
Dreamhost claims I must have Anon FTP activated in order to use the copy()
function.
I went ahead and set Anon FTP setup on the server. According to the admin
panel, I have the following settings:
Path:/home/campuscb/ftp.campuscorkboard.com
Directory blocks are on except for Stor
When I run it, I get the following message in the browser:
Warning: open_basedir restriction in effect. File is in wrong directory in
/home/.paco/campuscb/campuscorkboard.com/upload.php on line 28 Couldn't copy
the file
Any help would be appreciated.
Thanks,
James