1

Hey. I need to upload some files (images/pdf/pp) to my SQLS Database and thereafter, download it again. I'm not sure what is the best solution - store it as bytes, or store it as file (not sure if possible). I need later to databind multiple domain classes together with that file upload.

Any help would be very much apreciated, JM

John
  • 259
  • 8
  • 19

1 Answers1

1

saving files in the file system or in the DB is a general question which is asked here several times.

check this: Store images(jpg,gif,png) in filesystem or DB?

I recommend to save the files in the file system and just save the path in the DB. (if you want to work with google app-engine though you have to save the file as byte array in the DB as saving files in the file system is not possible with google app-engine)

To upload file with grails check this: http://www.grails.org/Controllers+-+File+Uploads

Community
  • 1
  • 1
mjspier
  • 6,386
  • 5
  • 33
  • 43
  • Same is true for Cloud Foundry. If you decide on storing files in the DB, you might want to use the Attachmentable plugin. Note that the progress bar doesn't work. – Brad Rhoads May 18 '11 at 09:29