Re: Help with copy()/uploading a file
| From: | Catalin Trifu | Date: | Sun, 31 Aug 2003 11:47:01 +0000 |
| Subject: | Re: Help with copy()/uploading a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161293@lists.php.net to get a copy of this message | ||
Hi,
Take a look here:
http://de2.php.net/manual/en/features.safe-mode.php#ini.open-basedir
Basically toy have opne_basedir in effect which means you can only
access
subdirs of the base dir, which in your case is, (I suppose)
/home/.paco/campuscb/campuscorkboard.com/
So take a look in php.ini (if you can access it)
Cheers,
Catalin
"James Johnson" <james@smb-studios.com> wrote in message
news:000001c36f5c$f1ff2350$6401a8c0@james...
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