File upload problem

From: Date: Thu, 23 Aug 2001 09:31:32 +0000
Subject: File upload problem
Groups: php.general 
Request: Send a blank email to php-general+get-64069@lists.php.net to get a copy of this message
Hello there, I am trying to create a form for uploading files to the local intranet. Therefore I created a form for uploading files as mentioned in the PHP manual. After submitting the form I want to copy the file to the intranet with as name the original name on the system of the client. The problem is that the file is not being uploaded... The code i have is: <? if ($subactie == ""){ // File upload form showen echo "<form type='multipart/form-data' action='index.php?actie=formulieren&subactie=upload' method='post'> <input type='hidden' name='MAX_FILE_SIZE' value='100000' Upload dit bestand: <input name='userfile' type='file'><br> <input type='submit' value='Upload file'> </form>"; } if ($subactie == "upload"){ // Upload the file if (!copy($userfile, $userfile_name)) { echo "error while uploading!"; } else { echo "file uploaded successful!"; } } ?> The file I try to upload (c:\ws_ftp.log which I currently use as randomly selected testfile) does exist on the harddisk (selected via the browse button). When I execute the code I get the folowing output: "Warning: Unable to open 'C:\\WS_FTP.LOG' for reading: No such file or directory in /usr/local/www/intranet.lync.nl/test/service/srv_formulieren.php on line 13 error while uploading! " I am sure I overlooked something, but can't find it. I hope someone can help me to find the problem. Some additional information: The upload_tmp dir. is set to a temp directory in the root of the intranet root. The directory is owned by the same user as the php/apache server is running. This user has all rights on the directorys involved Thank you all in advance. Kind regards, A.D. Vijverberg dvijverberg@lync.nl

« previous php.general (#64069) next »