Creating a "Register" form I found with the classic dilemma:

Uploading a picture.


Uploaded file will be named UserId.OriginalExtension. I mean 5565.jpg is
photo from user 5565 and is in JPEG format.

Not bad.


But what happens when Model does not validate, Insert is not done and there
is no ID to use as filename?


Does cake have something to help in this classic doubt?

What's better?


MICROTIME + SESSIONID . Extension may be the image's new name, and then keep
it included in a HIDDEN field in form, may be a solution. Then File can be
renamed to LastInsertedId.



How do you solve this kind of common and normal issues?


See you!


n.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to