admin管理员组文章数量:1415100
I'm using Dropzone.js for uploading files. Now I want to do some additional validation for some files. But I didn't found a way to get the absolute path of selected file. Please anyone tell me whether there have any way to get the file path.
This is the file array returned by dropzone when we add a file
accepted: true
lastModifiedDate: Wed Dec 17 2014 13:01:03 GMT+0530 (IST)
name: "xxxxxx.pdf"
previewElement: div.dz-preview.dz-file-preview.dz-processing
previewTemplate: div.dz-preview.dz-file-preview.dz-processing
processing: true
size: 407552
status: "uploading"
type: "application/pdf"
upload: ObjectwebkitRelativePath: ""
xhr: XMLHttpRequest
__proto__: File
I'm using Dropzone.js for uploading files. Now I want to do some additional validation for some files. But I didn't found a way to get the absolute path of selected file. Please anyone tell me whether there have any way to get the file path.
This is the file array returned by dropzone when we add a file
accepted: true
lastModifiedDate: Wed Dec 17 2014 13:01:03 GMT+0530 (IST)
name: "xxxxxx.pdf"
previewElement: div.dz-preview.dz-file-preview.dz-processing
previewTemplate: div.dz-preview.dz-file-preview.dz-processing
processing: true
size: 407552
status: "uploading"
type: "application/pdf"
upload: ObjectwebkitRelativePath: ""
xhr: XMLHttpRequest
__proto__: File
Share
Improve this question
asked Mar 2, 2015 at 11:01
JamesJames
2,9844 gold badges32 silver badges56 bronze badges
6
- 1 did you find an answer to this? I have the exact same question... – CharlesA Commented Mar 17, 2015 at 7:49
- @CharlesA No, I didn't. – James Commented Mar 17, 2015 at 9:34
- thanks. fwiw, I managed to solve my problem - which was how to resend the file a second time using additional parameters - by using processFile() mand. Not sure it'll help in your case though – CharlesA Commented Mar 17, 2015 at 13:08
- @CharlesA it is better if you write your solution as an answer. That may help someone in the future. – James Commented Mar 17, 2015 at 18:35
- thanks. I didn't do that because it doesn't solve your problem! – CharlesA Commented Mar 17, 2015 at 18:37
1 Answer
Reset to default 2The full path es through in the POST data:
Dropzone.options.yourDropzoneID = {
init: function() {
this.on("sending", function(file, xhr, data) {
if(file.fullPath){
data.append("fullPath", file.fullPath);
}
});
}
};
本文标签: javascriptHow to get selected filepath in dropzonejsStack Overflow
版权声明:本文标题:javascript - How to get selected filepath in dropzone.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745150020a2644877.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论