You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to upload a file in electron (nodejs) using plupload by file path. I tried the following methods:
const form = new FormData()
form.append('file', fs.createReadStream(filePath));
uploader.addFile(form.file)
uploader.start();
Didn't work. I also tried:
var form = {
name: 'file1',
file: {
value: fs.createReadStream(filePath),
options: {
filename: 'Radio.xspf'
}
}
};
uploader.addFile(form.file)
uploader.start();
Also didn't work. I even tried to add a form in html, and then adding a file manually, and after that add the content of the html element using:
uploader.addFile(document.getElementById('files')) //Not working
uploader.addFile($('input[type="file"]')[0]) //Not working
In all cases, the file is not being added, as console.log(uploader.files) is empty. I need to implement adding files by path programmatically. Any ideas?
The text was updated successfully, but these errors were encountered:
I am trying to upload a file in electron (nodejs) using plupload by file path. I tried the following methods:
Didn't work. I also tried:
Also didn't work. I even tried to add a form in html, and then adding a file manually, and after that add the content of the html element using:
In all cases, the file is not being added, as console.log(uploader.files) is empty. I need to implement adding files by path programmatically. Any ideas?
The text was updated successfully, but these errors were encountered: