jQuery .getFiles is not a function
See original GitHub issueBare with me… I’m very new at this. I have the following code in jQuery and am trying to get the list of files using getFiles() method.
FilePond.registerPlugin(
FilePondPluginImagePreview,
FilePondPluginImageExifOrientation,
FilePondPluginFileValidateSize,
FilePondPluginFileValidateType
);
$('.filePond').filepond({
acceptedFileTypes: ['image/jpeg', 'video/mp4'],
fileValidateTypeLabelExpectedTypesMap: { 'image/jpeg': '.jpg', 'video/mp4': '.mp4' },
allowFileTypeValidation: true,
instantUpload: true,
labelIdle: 'Drag & Drop your pictures & video or <span class="filepond--label-action">Browse</span>',
maxFileSize: '100MB',
maxTotalFileSize: '100MB',
server: {
url: '/includes/ajax.asp',
process: {
url: '?Action=ProcessUpload',
onload: test
},
fetch: null,
revert: null
}
});
function test() {
console.log( FilePond.getFiles() );
}
SUMMARY After successfully processing a file the test() function executes and errors out with Uncaught TypeError: FilePond.getFiles is not a function
I have also tried using $(‘.filePond’).filepond().getFiles() which also errors out.
EXPECTED BEHAVIOR I would like to get a list of all the files processed.
Environment | Version |
---|---|
OS | Windows 10 |
Device | Desktop |
Browser | Chrome 72.0.3626.119 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Kendo v2014.3.1119 - Upload - getFiles is not a function
getFiles()) });. I got the following error: Uncaught TypeError: hey.getFiles is not a function. I followed the example from here.
Read more >FileSystemDirectoryEntry.getFile() - Web APIs - MDN Web Docs
An object which allows you to specify whether or not to create the entry if it's missing and if it's an error if...
Read more >getFiles - API Reference - Kendo UI Upload - Documentation
Represents an Array collection of all currently selected files.
Read more >How to check input file is empty or not using JavaScript/jQuery
Approach 1: Use element.files.length property to check file is selected or not. If element.files.length property returns 0 then the file is not ...
Read more >Upload a file by using the REST API and jQuery
The jQuery(document).ready function checks for FileReader API ... FileReader) { alert('This browser does not support the FileReader API.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After some more testing I was able to figure it out.
If there is an easier way to do this let me know. Thanks for creating this excellent plugin!
@vovkandrew FilePond enhances the existing file input, so until the script loads, the original input will remain visible. Either load FilePond faster, or hide the original input until FilePond loads.
Will close the issue as the original question was resolved some time ago : )