Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
9a84967804 | |||
fb372a9bf7 | |||
28d8ab0152 | |||
87a34489b6 | |||
1cc8f813db | |||
4f7faba376 | |||
8cbd8d5da9 | |||
91ed183052 | |||
b127b788b2 |
@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'de.w665'
|
||||
version = '1.0.0'
|
||||
version = '1.1.1'
|
||||
|
||||
java {
|
||||
sourceCompatibility = '21'
|
||||
|
@ -172,12 +172,20 @@ export class DownloadComponent {
|
||||
|
||||
const blob = new Blob([response.data], {type: 'application/octet-stream'});
|
||||
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.href = url;
|
||||
a.download = filename;
|
||||
a.id = 'fileDownloadBlob';
|
||||
document.body.appendChild(a);
|
||||
|
||||
this.saveDownloadedFile();
|
||||
|
||||
// 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 |
@ -2,7 +2,7 @@
|
||||
<html lang="en" data-theme="light">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Frontend</title>
|
||||
<title>SharePulse</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
@ -12,9 +12,11 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Date;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -95,8 +97,8 @@ public class FileService {
|
||||
|
||||
|
||||
Path path = Paths.get(getTempDirPath() + File.separator + fileId);
|
||||
try {
|
||||
Files.write(path, file.getBytes());
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
Files.copy(inputStream, path, StandardCopyOption.REPLACE_EXISTING);
|
||||
log.debug("File " + file.getOriginalFilename() + " written to " + path.getFileName());
|
||||
return fileUpload;
|
||||
} catch (IOException e) {
|
||||
|
Reference in New Issue
Block a user