mirror of
https://github.com/RoastSlav/quickdrop.git
synced 2026-01-06 22:50:01 -06:00
debugging failed file upload on prod but not in dev
This commit is contained in:
@@ -33,6 +33,8 @@ public class FileService {
|
||||
}
|
||||
|
||||
public FileEntity saveFile(MultipartFile file, FileUploadRequest fileUploadRequest) {
|
||||
logger.info("File received: {}", file.getOriginalFilename());
|
||||
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
Path path = Path.of(fileSavePath, uuid);
|
||||
try {
|
||||
@@ -40,6 +42,7 @@ public class FileService {
|
||||
Files.write(path, file.getBytes());
|
||||
logger.info("File saved: {}", path);
|
||||
} catch (Exception e) {
|
||||
logger.error("Error saving file: {}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ document.getElementById("uploadForm").addEventListener("submit", function (event
|
||||
}
|
||||
} else {
|
||||
alert("Upload failed. Please try again.");
|
||||
console.log(xhr.responseText);
|
||||
document.getElementById("uploadIndicator").style.display = "none";
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user