MCPcopy Create free account
hub / github.com/error311/FileRise / wireFileInputChange

Function wireFileInputChange

public/js/upload.js:194–215  ·  view source on GitHub ↗
(fileInput)

Source from the content-addressed store, hash-verified

192}
193
194function wireFileInputChange(fileInput) {
195 if (!fileInput || fileInput.__uploadChangeBound) return;
196 fileInput.__uploadChangeBound = true;
197
198 // For file picker, remove directory attributes so only files can be chosen.
199 fileInput.removeAttribute("webkitdirectory");
200 fileInput.removeAttribute("mozdirectory");
201 fileInput.removeAttribute("directory");
202 fileInput.setAttribute("multiple", "");
203
204 fileInput.addEventListener("change", async function () {
205 const files = Array.from(fileInput.files || []);
206 if (!files.length) return;
207
208 if (useResumable) {
209 await queueResumableFiles(files);
210 } else {
211 // Non-resumable: normal XHR path, drag-and-drop etc.
212 processFiles(files);
213 }
214 });
215}
216
217function setUploadButtonVisible(visible) {
218 const btn = document.getElementById('uploadBtn');

Callers 1

setDropAreaDefaultFunction · 0.85

Calls 2

queueResumableFilesFunction · 0.85
processFilesFunction · 0.85

Tested by

no test coverage detected