Hi,
I want to add a folder (including all the files and subfolders in it) using the IPFS API. Please suggest a method for doing the same.
Currently I am using html and jquery to input the folder as shown below:-
html
<form id="file-catcher">
<input id="file-input" type="file" webkitdirectory mozdirectory multiple>
<p>Drag your folder here or click in this area</p>
<button type="submit" name="upload">Upload</button>
</form>
JS/JQuery
$(document).ready(function() {
$('form input').change(function () {
$('form p').text(this.files.length + " file(s) selected");
});
});
var inps = document.querySelectorAll('input');
[].forEach.call(inps, function(inp) {
inp.onchange = function(e) {
console.log(this.files);
};
});
Also, please suggest a method to handle the uploaded folder using javascript.
Thanks.