Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Uploading Files
 with Grails
Grails.org/File+Upload
 Step 1. Create the form in the view
Grails.org/File+Upload
Step 2. Handle the upload in the controller




          MultipartHttpServletRequest
Grails.org/File+Upload
 Step 3. Transfer files to your local drive
Grails.org/File+Upload
     Step 3. Transfer files to your local drive

returns org.springframework.web.multipart.commons.C...
Real World Example
Create the ability for a user to
upload their avatar to their profile.
Real World Example
Create the ability for a user to
upload their avatar to their profile.


1. Create a new Grails
   appli...
$ grails generate-all berry.User
FileUploadService.groovy
http://github.com/cavneb/FileUploader
Upload files with grails
Upload files with grails
Upload files with grails
Upload files with grails
Upload files with grails
Upload files with grails
Upload files with grails
Upcoming SlideShare
Loading in …5
×

Upload files with grails

57,304 views

Published on

Walkthrough on creating file upload functionality to a User domain class.

Upload files with grails

  1. 1. Uploading Files with Grails
  2. 2. Grails.org/File+Upload Step 1. Create the form in the view
  3. 3. Grails.org/File+Upload Step 2. Handle the upload in the controller MultipartHttpServletRequest
  4. 4. Grails.org/File+Upload Step 3. Transfer files to your local drive
  5. 5. Grails.org/File+Upload Step 3. Transfer files to your local drive returns org.springframework.web.multipart.commons.CommonsMultipartFile
  6. 6. Real World Example Create the ability for a user to upload their avatar to their profile.
  7. 7. Real World Example Create the ability for a user to upload their avatar to their profile. 1. Create a new Grails application ‘FileUploader’ 2. Create a new Domain Class ‘User’ 3. Generate Controller/ Views for User
  8. 8. $ grails generate-all berry.User
  9. 9. FileUploadService.groovy
  10. 10. http://github.com/cavneb/FileUploader

×