Upload files with grails

50,878 views
50,800 views

Published on

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

7 Comments
21 Likes
Statistics
Notes
No Downloads
Views
Total views
50,878
On SlideShare
0
From Embeds
0
Number of Embeds
11,056
Actions
Shares
0
Downloads
639
Comments
7
Likes
21
Embeds 0
No embeds

No notes for slide

















  • 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

    ×