6
votes

Hello I need to use http://www.dropzonejs.com/ for upload file in my XPages. I thought about using to use the XAgent for handle Mark Leusink:

http://openntf.org/XSnippets.nsf/snippet.xsp?id=custom-xpage-file-upload-handler

But always I have problem error 500 that's not a file! exception....

it seems that control DropZone js not send the file with the parameter, I do not understand with Firebug

DropZone is very simple...

$(function () {
 // $("div#FileIDUpload").dropzone({ url: "xUpload.xsp" });
   var myDropzone = new Dropzone("div#FileIDUpload", { url: "xUpload.xsp"});
   Dropzone.options.myAwesomeDropzone = {
      paramName: "uploadedFile", // The name that will be used to transfer the file
      clickable:true,
      uploadMultiple:false,
      maxFilesize: 2, // MB
      accept: function(file, done) {
          if (file.name == "justinbieber.jpg") {
          done("Naha, you don't.");
      }
      else { done(); }
   }
  }
});

Someone have suggestion?

Thanks!

UPDATE

I've solve! the problem is the programmatic use this is correct

$(function () {
 // $("div#FileIDUpload").dropzone({ url: "xUpload.xsp" });
   var myDropzone = new Dropzone("div#FileIDUpload", { 
    paramName: "uploadedFile", // The name that will be used to transfer the file
   url: "xUpload.xsp",
   clickable:true,
      uploadMultiple:false,
      maxFilesize: 2 // MB

   });


});
1
This seems like a very useful question, I think you should answer your own question, so that others will easier see that it is solved.Steve Zavocki
You already answered the question yourself, but I decided to publish the demo database anyway: linqed.eu/2015/11/28/…Mark Leusink
As Steve said it would be good if you posted the solution as an answer to your own question, and then mark it as the accepted answerBrian Gleeson - IBM

1 Answers

0
votes

OK In have solve with this code

    $(function () {
 // $("div#FileIDUpload").dropzone({ url: "xUpload.xsp" });
   var myDropzone = new Dropzone("div#FileIDUpload", { 
    paramName: "uploadedFile", // The name that will be used to transfer the file
   url: "xUpload.xsp",
   clickable:true,
      uploadMultiple:false,
      maxFilesize: 2 // MB

   });


});