-
Jul 18th, 2012, 06:52 AM
#1
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
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
-
Forum Rules