+
Upload File
+
Drag and drop files, or click to select the files you want to share.
@@ -57,10 +58,9 @@
Upload Another File
-
Drag and drop files, or click to select the files you want to share.
+
diff --git a/frontend/src/app/upload/upload.component.ts b/frontend/src/app/upload/upload.component.ts
index 5661c04..316b99e 100644
--- a/frontend/src/app/upload/upload.component.ts
+++ b/frontend/src/app/upload/upload.component.ts
@@ -31,9 +31,7 @@ export class UploadComponent {
uploadStarted: boolean = false;
uploadProgress = 0; // Real progress
targetUploadProgress = 0; // New target progress to reach
-
uploadFinished = false;
-
uploadSpeedBps: number = 0;
@@ -103,18 +101,6 @@ export class UploadComponent {
.catch(error => {
console.error('Upload failed:', error.response ? error.response.data : error.message);
});
-
-
- /*// Old simulation of upload progress
- const interval = setInterval(() => {
- if (this.uploadProgress < 100) {
- this.uploadProgress++;
- } else {
- clearInterval(interval); // Stop the interval when progress reaches 100%
- this.uploadFinished = true;
- }
- }, 10);*/
-
}
}
diff --git a/src/main/java/de/w665/sharepulse/rest/mappings/SpeedTest.java b/src/main/java/de/w665/sharepulse/rest/mappings/SpeedTest.java
index 35345d8..2abd779 100644
--- a/src/main/java/de/w665/sharepulse/rest/mappings/SpeedTest.java
+++ b/src/main/java/de/w665/sharepulse/rest/mappings/SpeedTest.java
@@ -22,7 +22,7 @@ public class SpeedTest extends ApiRestController {
*/
@GetMapping("/speed-test")
public void speedTest(HttpServletResponse response) {
- byte[] dummyData = new byte[1024 * 1024];
+ byte[] dummyData = new byte[1024 * 1024 / 2];
response.setContentType("application/octet-stream");
response.setContentLength(dummyData.length);
response.setStatus(HttpServletResponse.SC_OK);
@@ -37,7 +37,7 @@ public class SpeedTest extends ApiRestController {
@PostMapping("/upload-speed-test")
public void uploadSpeedTest(HttpServletRequest request, HttpServletResponse response) {
- final int maxBytes = 1024 * 1024; // Limit to 1MB
+ final int maxBytes = 1024 * 1024 / 2; // Limit to 0.5MB
byte[] buffer = new byte[1024]; // Buffer to read data
int bytesRead;
int totalBytesRead = 0;