MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / renameFile

Function renameFile

webUi/scripts.js:367–380  ·  view source on GitHub ↗
(filePath, oldName)

Source from the content-addressed store, hash-verified

365 _("uploadSpiffs").style.display = 'none';
366}
367function renameFile(filePath, oldName) {
368 const actualFolder = _("actualFolder").value;
369 const fileName = prompt("Enter the new name: ", oldName);
370 if (isNullOrEmpty(fileName)) {
371 window.alert("Invalid Name");
372 } else {
373 const formdata5 = new FormData();
374 formdata5.append("filePath", filePath);
375 formdata5.append("fileName", fileName);
376 const xhr = httpRequest("POST", "/rename", { async: false, body: formdata5 });
377 _("status").innerHTML = xhr.responseText;
378 listFilesButton(actualFolder);
379 }
380}
381function downloadDeleteButton(filename, action) {
382 const urltocall = "/file?name=" + filename + "&action=" + action;
383 const actualFolder = _("actualFolder").value;

Callers

nothing calls this directly

Calls 4

_Function · 0.85
isNullOrEmptyFunction · 0.85
httpRequestFunction · 0.85
listFilesButtonFunction · 0.85

Tested by

no test coverage detected