dropzonejs和XPages上传

时间:2015-11-26 19:17:05

标签: xpages xpages-ssjs

您好我需要在我的XPage中使用http://www.dropzonejs.com/上传文件。 我想过使用XAgent来处理Mark Leusink:

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

但总是我有问题错误500,这不是一个文件!例外....

似乎控制DropZone js没有用参数发送文件,我不明白Firebug

DropZone非常简单......

$(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(); }
   }
  }
});

有人有建议吗?

谢谢!

更新

我已经解决了! 问题是程序化使用 这是正确的

$(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 个答案:

答案 0 :(得分:0)

确定已解决此代码

    Info.model.findByIdAndUpdate(req.body.id, { $set: {field1: req.body.item1, field2: item2}}, 
            function(err, info) {
            if (err) {
                next(err);
            }
    });
相关问题