Re: Uploading files

From: Date: Thu, 27 Jun 2002 21:25:36 +0000
Subject: Re: Uploading files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-104233@lists.php.net to get a copy of this message
Well, apparently $_POST[passcodeFile] is empty. The first question that comes to mind is whether you have the correct array index there. The second is why do you need the double quotes surrounding it. You should try echoing $_POST[passcodeFile] and see if it contains anything. Bogdan Tyler Longren wrote:
Hello, I usually use this code to upload files when I have a form with <input type=file name=passcodeFile> It no longer works for some reason: $data = fread(fopen("$_POST[passcodeFile]", "r"), filesize("$_POST[passcodeFile]")); Here are the errors that it produces: Warning: fopen("", "r") - Success in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 Warning: stat failed for (errno=2 - No such file or directory) in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 Warning: fread(): supplied argument is not a valid File-Handle resource in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 The "$data =" line is line number 146. Does anyone seen anything wrong with this? Thanks,


« previous php.general (#104233) next »