Re: File uploads and handling
| From: | Philip Thompson | Date: | Fri, 29 Oct 2004 00:04:27 +0000 |
| Subject: | Re: File uploads and handling | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200595@lists.php.net to get a copy of this message | ||
On Oct 26, 2004, at 7:06 AM, Jason Wong wrote:
On Tuesday 26 October 2004 03:45, Philip Thompson wrote:Yeah, that was not useful at all. That's what I originally looked at. If anyone has some "code" that shows how to reference the actual file, then that would be helpful. I have pulled my hair out long enough over this one. I did try this, but nothing changed (b/c it's just an array): if (is_uploaded_file(_FILES['userfile']))I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? ------- if (is_uploaded_file($_FILES['userfile']['name']))In the above you are only referencing the *filename* and not the actual uploaded file itself.$handle = fopen($_FILES['userfile']['name'], "r");elseecho $filename . " was not uploaded properly";------- I know the actual filename shows up...but somehow it's not uploading. Ideas?Read manual > Handling file uploads to see how it all works.
$handle = fopen($_FILES['userfile'], "r");Tips would be wonderful. Thanks! ~Philip