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

Detect when upload from URL gives an HTTP error #189

Closed
drn05r opened this issue Jan 5, 2022 · 5 comments
Closed

Detect when upload from URL gives an HTTP error #189

drn05r opened this issue Jan 5, 2022 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@drn05r
Copy link
Contributor

drn05r commented Jan 5, 2022

A common problem when using Upload from URL, is that users submit a URL, which is behind a login. Therefore, when EPrints tries to download the publication, it gets redirect to a login screen or 403 page and ends up downloading this rather than the intended file (i.e. the PDF document of the publication). Upload from URL should be improved to make sure it does not get a an HTTP error code and it it does, not download anything it gets back from the HTTP request, as this will not be the intended file.

@drn05r drn05r added the bug Something isn't working label Jan 5, 2022
@drn05r drn05r added this to the 3.4.4 milestone Jan 5, 2022
@drn05r drn05r self-assigned this Jan 5, 2022
@drn05r
Copy link
Contributor Author

drn05r commented Jan 25, 2022

maybe have field for upload url.

@drn05r
Copy link
Contributor Author

drn05r commented Apr 1, 2022

A upload failed message is generated when a 401 error is received (through having an .htpasswd protected directory) and no zero byte file is created.

@drn05r
Copy link
Contributor Author

drn05r commented Apr 1, 2022

Uploading an actual zero byte file (that will give a 200 HTTP code) will create a document record but not create a directory and empty file in the appropriate documents sub-directory,

@drn05r
Copy link
Contributor Author

drn05r commented Apr 1, 2022

301 redirects do not cause issues. Upload fails if redirect URL 404s and file from that redirected URL is uploaded if it is present. Adding the upload_url field will be useful to work out what URL was actually submitted to upload from URL.

@drn05r
Copy link
Contributor Author

drn05r commented Apr 11, 2022

After reviewing various potential reasons behind this issue. I think the above two improvements is as much as we can do for now. They will hopefully limit situations where zero byte file eprints get added to the live archive and give some traceability if they do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant