Announcement Announcement Module
Collapse
No announcement yet.
Upload a file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upload a file

    Hi there,

    I cant figure out how can I have a formRemote with a field of type file inside. Something like

    <g:formRemote name="funcToAdd" url="[controller:'c1', action:'funcToAdd']" update="funcToAddResult" >
    <g:hiddenField name="profile" value="${pf.id}"/>
    <g:textArea name="description" rows="5" cols="40" value="description')}" />
    <input type="file" id="pfimage" name="pfimage"/>
    <g:submitButton name="buttonAdd" value="Add new"/>
    </g:formRemote>

    I know that to call request.getFile in the controller c1, I have to use enctype="multipart/form-data", but this is not solving my problem.

    In the controller I'm calling
    def desc = params.description
    def uploadedFile = request.getFile("pfimage") // to get image

    Can anyone help ?

    Thanks in advance

  • #2
    in Confiig.groovy search for this:

    grails.disable.multipart = false


    or something like that ;]

    gl & hf

    Comment

    Working...
    X