Results 1 to 2 of 2

Thread: Upload a file

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Default 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. #2
    Join Date
    Aug 2012
    Posts
    1

    Default

    in Confiig.groovy search for this:

    grails.disable.multipart = false


    or something like that ;]

    gl & hf

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •