On Wednesday 11 December 2002 17:30, Steve Jackson wrote:
> I'm trying to rename an uploaded file with the value of a select I have
> in the uploaded form. Can someone point me in the right direction. The
> PHP.net rename manual isn't helping a lot? My code:

What is the problem?

> //eshop_upload.php
> <?php
> // Upload the picture to the selected directory and rename the file as
> the category number.
> if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
>       {
> copy($HTTP_POST_FILES['userfile']['tmp_name'],"http://www.violasystems.c
> om/images/");

You've copied the uploaded file to another directory ...

>       rename("($HTTP_POST_FILES['userfile']['tmp_name'])",
> "$category");

... but now you're renaming the [temporary] uploaded file? Shouldn't you be 
renaming the above copied file?

In fact you should be able to do it in a single step by copying the uploaded 
file to its new destination and new filename.

Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

Age before beauty; and pearls before swine.
                -- Dorothy Parker

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

Reply via email to