9 Commits

Author SHA1 Message Date
9a84967804 Merge pull request 'bugfix/ram-consumption' (#17) from bugfix/ram-consumption into main
Reviewed-on: https://git.walzen665.de/Walzen665/sharepulse/pulls/17
2024-03-09 21:39:33 +00:00
Max
fb372a9bf7 Updated version to 1.1.1 2024-03-09 22:27:54 +01:00
Max
28d8ab0152 Refactored file writing to use Stream 2024-03-08 19:53:53 +01:00
87a34489b6 Merge pull request 'bugfix/icon' (#16) from bugfix/icon into main
Reviewed-on: https://git.walzen665.de/Walzen665/sharepulse/pulls/16
2024-03-07 22:24:33 +00:00
Max
1cc8f813db Updated version to 1.1.0 2024-03-07 23:20:48 +01:00
Max
4f7faba376 Fixed favicon
- Named application
2024-03-07 23:18:42 +01:00
8cbd8d5da9 Update build.gradle 2024-03-07 22:05:43 +00:00
91ed183052 Merge pull request 'Fixed download bug' (#15) from bugfix/download-cache into main
Reviewed-on: https://git.walzen665.de/Walzen665/sharepulse/pulls/15
2024-03-07 22:01:10 +00:00
Max
b127b788b2 Fixed download bug
- Fixed: Multiple files could not be downloaded due to a caching issue
2024-03-07 22:54:50 +01:00
5 changed files with 15 additions and 5 deletions

View File

@ -5,7 +5,7 @@ plugins {
} }
group = 'de.w665' group = 'de.w665'
version = '1.0.0' version = '1.1.1'
java { java {
sourceCompatibility = '21' sourceCompatibility = '21'

View File

@ -172,12 +172,20 @@ export class DownloadComponent {
const blob = new Blob([response.data], {type: 'application/octet-stream'}); const blob = new Blob([response.data], {type: 'application/octet-stream'});
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
// Check if download blob already exists and remove it if it does
let a = document.getElementById('fileDownloadBlob') as HTMLAnchorElement | null;
if (a !== null) {
a.remove();
}
a = document.createElement('a');
a.style.display = 'none'; a.style.display = 'none';
a.href = url; a.href = url;
a.download = filename; a.download = filename;
a.id = 'fileDownloadBlob'; a.id = 'fileDownloadBlob';
document.body.appendChild(a); document.body.appendChild(a);
this.saveDownloadedFile(); this.saveDownloadedFile();
// Clean up by revoking the Blob URL and removing the temporary anchor (currently disabled due to saveDownloadBtn) // Clean up by revoking the Blob URL and removing the temporary anchor (currently disabled due to saveDownloadBtn)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,7 +2,7 @@
<html lang="en" data-theme="light"> <html lang="en" data-theme="light">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Frontend</title> <title>SharePulse</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">

View File

@ -12,9 +12,11 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Date; import java.util.Date;
import java.util.Optional; import java.util.Optional;
@ -95,8 +97,8 @@ public class FileService {
Path path = Paths.get(getTempDirPath() + File.separator + fileId); Path path = Paths.get(getTempDirPath() + File.separator + fileId);
try { try (InputStream inputStream = file.getInputStream()) {
Files.write(path, file.getBytes()); Files.copy(inputStream, path, StandardCopyOption.REPLACE_EXISTING);
log.debug("File " + file.getOriginalFilename() + " written to " + path.getFileName()); log.debug("File " + file.getOriginalFilename() + " written to " + path.getFileName());
return fileUpload; return fileUpload;
} catch (IOException e) { } catch (IOException e) {