<g:remoteFunction>

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

<g:remoteFunction>

sshehab
hi i have this ajax code to upload files
$(".inputFiles").on("change", function(e) {
   
var uploadedFiles = e.originalEvent.target.files;
   
var fileSize = 100;
   
var fileType = ["image/jpeg", "image/pjpeg"];

    alert
("length" + uploadedFiles.length)
   
for (var i = 0,len = uploadedFiles.length; i < len; i++) {
       
var n = uploadedFiles[i].name;
       
var s = uploadedFiles[i].size;
       
var t = uploadedFiles[i].type;


                   
}
 
<g:remoteFunction controller="photos" action="testAjax" params= "\'files=\' + uploadedFiles" />
     
});

   
});

here is my GSP :
<input class="inputFiles" type="file" name="fileupload" multiple="multiple"/>

i need to know how to handle the  in the action the uploaded files found in   uploadedFiles   and send to the user notification in case for successful or failure upload .

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/e86a3be7-ee7c-4d10-81fa-0a13f827b424%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Sherif