Reply to file upload as "idnumber".bmp

Your name:

Reply:


Posted by matt on 05/04/07 20:01

Any help appreciated.

I have a form that does pretty well to collect data and upload a
persons picture to a directory on a server.

The part of the form that does the latter is:


copy($HTTP_POST_FILES['PhotoUpload']['tmp_name'],

"directory/pictures/" . $firstName . " " . $lastName . ".bmp" );



-------


So the file will save on the sever as "firstname lastname".bmp

But of course when people with the same name register, there is an
overwrite, plus for another application I would like the photo name to
be "idnumber.bmp"

At the moment the server adds a new id nuber for each line added to
the database and so there is a variable passing around called
$idnumber

I thought that I could make the above changed to this:

copy($HTTP_POST_FILES['PhotoUpload']['tmp_name'],

"directory/pictures/" . $idnumber . ".bmp" );


------

but this doesn't seem to work because I don't think that this value is
given a value until everything is posted to the server - which makes
sense because the id number is the unique incremental value given to
each row of the database.


Does anyone know how I can change this form to get it to do what I
need?

Thanks for any help

Matt

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация