parent
a6144cb4e9
commit
94623b7c4b
|
@ -24,7 +24,7 @@ function DownloadFile() {
|
||||||
// Create a temporary anchor element for downloading the file
|
// Create a temporary anchor element for downloading the file
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = 'downloaded-file.txt'; // Specify the filename
|
a.download = response.data.filename;
|
||||||
a.click();
|
a.click();
|
||||||
|
|
||||||
// Revoke the URL to release resources
|
// Revoke the URL to release resources
|
||||||
|
|
|
@ -9,10 +9,12 @@ function ShareFile() {
|
||||||
|
|
||||||
const handleFileUpload = (file) => {
|
const handleFileUpload = (file) => {
|
||||||
setFile(file);
|
setFile(file);
|
||||||
setPasscode('1234');
|
//setPasscode('1234');
|
||||||
|
console.log(file);
|
||||||
if (file) {
|
if (file) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('files', file);
|
formData.append('files', file);
|
||||||
|
formData.append('ttl', "2");
|
||||||
|
|
||||||
// Send POST request to the backend API using Axios
|
// Send POST request to the backend API using Axios
|
||||||
axios.post('http://127.0.0.1:8000/api/files/', formData)
|
axios.post('http://127.0.0.1:8000/api/files/', formData)
|
||||||
|
|
Loading…
Reference in New Issue