2

I, have successfully implemented uploadify script into my app, files are being uploaded to /web/uploads folder.
I have entity Order witch can have multiple attachments OneToMany-unidirectional relation to File entity, uploadify is a part of Order form. Now, I would like to transform ulpoaded files into File entity presisted to DB, and set it as related to Order that was created with form.

I suppose I have to add some kind of form ID to Order entity and persist it to DB, so uploadify can send this ID and I'll know witch files are related to witch form instance (Maybe use of CSRF token?)

In general, I have no clear idea of how to implement this feature, my english isn't very good, hope everyone will understand my intentions, I'll be thankful of any help or hints on implementation.

canni
  • 5,737
  • 9
  • 46
  • 68

1 Answers1

0

I have done this like that:

Each Order entity on construct gives an unique ID base64_encode(microtime()) witch is persisted into DB, then on files form I get this ID from DB and pass it with uploadify postData, them I have clear link witch file was uploaded to witch Order

canni
  • 5,737
  • 9
  • 46
  • 68