Re: [NEWBIE] Trying to create a function from an existing script
| From: | Jon | Date: | Fri, 28 Jan 2005 06:28:27 +0000 |
| Subject: | Re: [NEWBIE] Trying to create a function from an existing script | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207553@lists.php.net to get a copy of this message | ||
Dave,
Does $store_dir end with a slash? Is it writable by apache? What do
your log files reveal? What is the output of the script?
On Fri, 2005-01-28 at 15:18 +0900, Dave wrote:
> Jon,
> Thanks for responding. Unfortunately, it still doesn't work. I tried
> it exactly as you wrote, and it still gives me the message that it
> failed to upload.
> Also, I actually want to force a name change to the file, so that
> regardless of what the name of the file uploaded is, it gets changed to
> "imagefile.jpg". I did try it exactly as you suggested, and it didn't
> work so I think there is something else I'm doing wrong. But I thought I
> should mention now that I want to impose my own name on the file, to
> save confusion later.
>
> Here is the whole if() statement:
>
>
> if(move_uploaded_file($_HTTP_POST_FILES['upfile']['tmp_name'],rawurlencode($store_dir.
>
> "imagefile.jpg")))
> {
> echo("Uploaded ".$HTTP_POST_FILES['upfile']['name']."
> successfully.");
> }
> // If the copy function fails output a message.
> else
> {
> echo("Upload of ".$HTTP_POST_FILES['upfile']['name']." to
>
> ".$store_dir." failed.");
> }
>