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,
>
>  
>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to