File Upload Problem

From: Date: Wed, 20 Oct 2004 23:27:47 +0000
Subject: File Upload Problem
Groups: php.general 
Request: Send a blank email to php-general+get-199953@lists.php.net to get a copy of this message
This file upload problem has me very confused. The code is: $upload_dir = '/articles_store/'; $uploadfile = $upload_dir . basename($_FILES['userfile']['name']); if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) { } else { die ("Cannot upload file"); } (this code is practically verbatim the example from php.net) The directory '/articles_store' has permissions 777. And the user is and group are 'www' (the Apache user). But I keep getting the following error: [Wed Oct 20 19:01:34 2004] [error] PHP Warning: move_uploaded_file(/articles_store/case_for_base.pdf) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: No such file or directory in /usr/local/www/data-dist/cycle-smart/www/Articles/admin/articleinsert.php on line 50 [Wed Oct 20 19:01:34 2004] [error] PHP Warning: move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/var/tmp/phpibRXhc' to '/articles_store/case_for_base.pdf' in /usr/local/www/data-dist/cycle-smart/www/Articles/admin/articleinsert.php on line 50 Any help is very, very much appreciated. NM -- Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 nathan@cycle-smart.com (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax

« previous php.general (#199953) next »