diff --git a/safeshare/safeshare-frontend/src/pages/downloadFile.js b/safeshare/safeshare-frontend/src/pages/downloadFile.js index 6f6731c..3fcbcfe 100644 --- a/safeshare/safeshare-frontend/src/pages/downloadFile.js +++ b/safeshare/safeshare-frontend/src/pages/downloadFile.js @@ -44,7 +44,7 @@ function DownloadFile() { const handleDownloadFile = () => { if (passcode) { - axios.get(`${apiUrl}/api/files/${passcode}/`, {responseType: 'blob'}) + axios.get(`http://${apiUrl}/api/files/${passcode}/`, {responseType: 'blob'}) .then(response => { let filename = 'downloaded_file'; // Default filename let mimeType = 'application/octet-stream'; // Default MIME type diff --git a/safeshare/safeshare-frontend/src/pages/shareFile.js b/safeshare/safeshare-frontend/src/pages/shareFile.js index 7085ffb..e99838b 100644 --- a/safeshare/safeshare-frontend/src/pages/shareFile.js +++ b/safeshare/safeshare-frontend/src/pages/shareFile.js @@ -53,7 +53,7 @@ function ShareFile() { // Send POST request to the backend API using Axios axios - .post(`${apiUrl}/api/files/`, formData) + .post(`http://${apiUrl}/api/files/`, formData) .then((response) => { // Handle a successful response from the server, set passcode to "key" in the response body const data = response.data; @@ -61,7 +61,7 @@ function ShareFile() { // If data is an array, take the first item if (Array.isArray(data)) { const passcode = data[0].key; - const baseUrl = '${apiUrl}/api/files/'; + const baseUrl = 'http://' + apiUrl + '/api/files/'; setPasscode(passcode); setShareableLink(baseUrl + passcode);