File uploading?

From: Date: Wed, 31 Jan 2001 17:21:19 +0000
Subject: File uploading?
Groups: php.general 
Request: Send a blank email to php-general+get-37505@lists.php.net to get a copy of this message
Hello everybody, I'm trying to do a file upload from the users computer via HTML file form element to a Linux server running Apache. The file is selected by the user from her or his computer, they hit the submit button and the file goes to /print/ folder (dir relative to uploading script on the server). I use the following code: /**************************Upload'i file*********************/ function upload($file) { $name = split("\\\\",$file); // Get filename $name = end($name); $fd = fopen($file, "w+"); /*BTW, this is line 12 */ $filedata = addslashes(fread($fd, filesize($pilt))); fputs("/print/$name", stripslashes($filedata)); fclose($fd); /*copy($file,"print/".$name); Kopeeri fail kausta fputs($fp, $header); fclose($fp); unlink($file);*/ return $name; } /**************************Upload'i file*********************/ I get the following error code: /******************** ERROR *****************************/ Warning: fopen("C:\\Data\\Lauri\\Selja_seadused.doc","w+") - Permission denied in /home/saue/public_html/oigusaktid/funktsioonid.php3 on line 12 Warning: Supplied argument is not a valid File-Handle resource in /home/saue/public_html/oigusaktid/funktsioonid.php3 on line 13 Warning: Supplied argument is not a valid File-Handle resource in /home/saue/public_html/oigusaktid/funktsioonid.php3 on line 14 Warning: Supplied argument is not a valid File-Handle resource in /home/saue/public_html/oigusaktid/funktsioonid.php3 on line 15 /******************** ERROR *****************************/ Thanks for your help in advance! Yours truly, Lauri

« previous php.general (#37505) next »