John
John

Reputation: 259

grails file upload

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

Upvotes: 1

Views: 2882

Answers (1)

mjspier
mjspier

Reputation: 6536

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

Upvotes: 1

Related Questions