Skip to content

Commit

Permalink
fixed CSP and CORS errors, and file upload with progress is now funct…
Browse files Browse the repository at this point in the history
…ioning properly
  • Loading branch information
devvyhac committed Sep 24, 2021
1 parent 9076a1b commit 8b1c571
Show file tree
Hide file tree
Showing 9 changed files with 352 additions and 23,348 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# uploads/**
uploads/**
.idea

# Logs
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/FileUpload/SelectFileModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const SelectFileModal = ({
onChange={handleFileSelection}
/>

<span className="hover:text-white px-3 py-2 hover:bg-green-500 rounded-md text-center cursor-pointer">
<span className="border border-green-100 hover:text-white px-3 py-2 hover:bg-green-500 rounded-md text-center cursor-pointer">
Choose Files
</span>
{files && <span>{`${files.length} selected`}</span>}
Expand All @@ -123,7 +123,7 @@ const SelectFileModal = ({
key={file.name}
>
<div className="w-[350px] truncate">{file.name}</div>
<div>{(file.size / 1000000).toFixed(3)}MB</div>
<div>{(file.size / 1000000).toFixed(2)}MB</div>
</div>
))}
</div>
Expand Down
320 changes: 283 additions & 37 deletions frontend/src/components/FileUpload/UploadProgressModal.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions frontend/src/components/FileUpload/helpers/upload.helper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
class UploadFiles {
constructor (files, options) {
this.fileRequests = new WeakMap()
// this.endpoints = {
// UPLOAD: 'http://127.0.0.1:5500/api/v1/files/upload',
// UPLOAD_STATUS: 'http://127.0.0.1:5500/api/v1/files/uploadStatus',
// UPLOAD_REQUEST: 'http://127.0.0.1:5500/api/v1/files/uploadRequest'
// }

// this.endpoints = {
// UPLOAD: 'http://127.0.0.1:5500/api/v1/files/upload',
// UPLOAD_STATUS: 'http://127.0.0.1:5500/api/v1/files/uploadStatus',
// UPLOAD_REQUEST: 'http://127.0.0.1:5500/api/v1/files/uploadRequest'
// }

this.endpoints = {
UPLOAD: 'https://companyfiles.zuri.chat/api/v1/files/upload',
Expand Down
Loading

0 comments on commit 8b1c571

Please sign in to comment.