Re: Help with copy()/uploading a file
| From: | Marek Kilimajer | Date: | Wed, 03 Sep 2003 12:44:27 +0000 |
| Subject: | Re: Help with copy()/uploading a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161546@lists.php.net to get a copy of this message | ||
Use move_uploaded_file() instead of copy(). The former bypasses safe mode restrictions.
James Johnson wrote:
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