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