Upload/Rename Script

Upload/Rename Script

am 27.01.2008 04:39:16 von Fred Atkinson

Here's what I want to do:

There will be a Web page with a form and submit button that
executes a PHP script to perform the upload and then put up a page
with either a success or failure message.

I want to locate and existing or create a new PHP script that
will allow a file to be uploaded to a specific directory on a Web site
and rename it after the upload. I also want to incorporate some kind
of protection so that a file uploaded with the same name does not
overwrite a previously uploaded file (maybe put filename_1,
filename_2, etc. on subsequent uploads).

For the former, is there any way to upload it with a different
filename than on the client's machine (other than using the rename
command)? Example: filename is: thisfile.jpg. Have a browse button
to retrieve the file and a text line with another name (bill) and have
it upload as bill.jpg (or bill_1.jpg if a bill.jpg already exists)?

For the latter, I have a couple of ideas of how to code that.
But I wanted to see if there were any suggestions that there might be
a better way.

I would be grateful for any suggestions.

Regards,



Fred

Re: Upload/Rename Script

am 28.01.2008 04:55:08 von Steve

"Fred Atkinson" wrote in message
news:rlunp35e808h9gkc6e89qjls47lpv2n6e0@4ax.com...
> Here's what I want to do:
>
> There will be a Web page with a form and submit button that
> executes a PHP script to perform the upload and then put up a page
> with either a success or failure message.



> I would be grateful for any suggestions.

dear professor, i lend you the old cliche, "what is good for the goose, is
also good for the gander." i cannot imagine you would teach your students by
giving them the answers. more than likely, you have required reading and
other prerequisites to any of your courses. i'd also imagine you would hold
students not willing to work with the greatest of distain and issue failing
grades.

given the plethura of information, examples, and manuals and other written
text on the *many* basic questions you have, i find it abhorent that you
simply ignore them all and ask us here to provide solutions for you - asking
us to rewrite or restate what already exists, yet presenting it here for
*your* convenience.

what you have discribed is a process. it is well defined. now, go and
program it. don't ask us to. unless you not only assign work to your
students where that work is already completed for them by you, don't expect
us to do something other than for you.