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

Function beginUploadTarget

src/webInterface.cpp:349–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349bool beginUploadTarget(File &file, const String &filename) {
350 if (uploadFolder == "/") uploadFolder = "";
351 if (!update) {
352 launcherConsolePrintf("File: %s/%s\n", uploadFolder.c_str(), filename.c_str());
353 String fullPath = uploadFolder + "/" + filename;
354 String dirPath = fullPath.substring(0, fullPath.lastIndexOf("/"));
355 if (dirPath.length() > 0) createDirRecursive(dirPath);
356 file = SDM.open(fullPath, "w");
357 return static_cast<bool>(file);
358 }
359
360 LauncherUpdateTarget target;
361 if (launcherUpdateTargetFromCommand(command, target) && launcherUpdateBegin(target, file_size)) {
362 prog_handler = target == LAUNCHER_UPDATE_APP ? 0 : 1;
363 progressHandler(0, file_size);
364 return true;
365 }
366 displayRedStripe("FAIL 365: " + String(launcherUpdateLastError()));
367 launcherDelayMs(3000);
368 return false;
369}
370
371bool finishUploadTarget(File &file) {
372 if (!update) {

Callers 1

streamMultipartUploadFunction · 0.85

Calls 8

launcherConsolePrintfFunction · 0.85
createDirRecursiveFunction · 0.85
launcherUpdateBeginFunction · 0.85
progressHandlerFunction · 0.85
displayRedStripeFunction · 0.85
launcherUpdateLastErrorFunction · 0.85
launcherDelayMsFunction · 0.85

Tested by

no test coverage detected