Retrieve uploaded relativePath file on server side

I'm using fileUpload from Primefaces (JSF framework) based on jQuery-File-Upload. I'm trying to make this component supporting drag&drop folder thanks to new File API of Firefox or Chrome. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory#Example So far, I've been able to make it happen thanks to passthrough attribute.

One of the interesting feature is "webkitRelativePath" allowing to know the relative path of an uploaded file.

I'm wondering how I could retrieve this info on server side, so I can create an object with this new info.

Thanks for your help.


Well I just read his from fileupload.js:

_initXHRData: function (options) {
     ...
     formData.append(
     ($.type(options.paramName) === 'array' &&
          options.paramName[index]) || paramName,
          file,
          file.uploadName || file.name
     );
     ...
}

(file containing webKitRelativePath)

So I guess the info is already pass to the server, don't you think? Since i'm using Servlet 3.0, I should be able to retrieve it from Part object, finger crossed...

链接地址: http://www.djcxy.com/p/46226.html

上一篇: 我的课不是一个servlet错误

下一篇: 在服务器端检索上传的relativePath文件