Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upload file #1023

Closed
MarisArins opened this issue Feb 15, 2021 · 6 comments · Fixed by #1024
Closed

Cannot upload file #1023

MarisArins opened this issue Feb 15, 2021 · 6 comments · Fixed by #1024
Assignees
Labels
Milestone

Comments

@MarisArins
Copy link

While in Submission form drag&drop a file on form and "Upload Failed" appears on screen.

In developer tools network tab you can see an error response to workspace save request :
{timestamp: "2021-02-15T22:09:04.642+0000", status: 403, error: "Forbidden",…} error: "Forbidden" message: "Access is denied. Invalid CSRF token." path: "/server/api/submission/workspaceitems/3508" status: 403 timestamp: "2021-02-15T22:09:04.642+0000"

@MarisArins MarisArins changed the title Cannot uol Cannot upload file Feb 15, 2021
@tdonohue tdonohue self-assigned this Feb 16, 2021
@tdonohue
Copy link
Member

I've been able to reproduce this. It's actually a backend issue (so, I'll move this to the backend). It seems to have been accidentally caused by DSpace/DSpace#3103 I'll claim this and get it fixed.

@tdonohue tdonohue transferred this issue from DSpace/dspace-angular Feb 16, 2021
@tdonohue
Copy link
Member

My mistake...after further investigation, it seems this is a bug in dspace-angular. Moving this ticket back.

@tdonohue tdonohue transferred this issue from DSpace/DSpace Feb 17, 2021
@tdonohue
Copy link
Member

The issues is with the ng2-file-upload library, which doesn't seem to fully support Http interceptors (like our xsrf.interceptor.ts which manages CSRF/XSRF tokens for all parts of our Angular app). This is a known issue in ng2-file-upload: valor-software/ng2-file-upload#950

I've found a temporary workaround...but, longer term, this is another reason to move away from ng2-file-upload as originally recommended in #820

@vahem2lu
Copy link

vahem2lu commented Mar 2, 2021

Is there a temporary workaround for public as well? Or when is merge planned?

@tdonohue
Copy link
Member

tdonohue commented Mar 2, 2021

@vahem2lu : Unfortunately there's no easy workaround, unless you want to install the under review PR locally (#1024). Merging will occur as soon as that PR is approved...currently it's undergoing further testing though (it seems to mostly work, but initial tests found an additional bug...now it's waiting for a follow-up review).

@tdonohue
Copy link
Member

tdonohue commented Mar 3, 2021

@vahem2lu : Just a quick follow up. This bug has now been fixed on our "main" branch, as the PR was approved & merged today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants