-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
500 internal server error for frappe.utils.file_manager.download_file #26424
Comments
Have you tried looking into the response? Like what did the server respond in the body, |
The response is:
I just realised it changed the private path to public. Is it not possible to use this method on private files? Is there any other way to download files without making them public? |
You should be able to. Check out the File document for the image you're trying to download, it likely has "public" ticked while it's in private...the state is inconsistent and should not exist under regular conditions. |
No it is a private file:
|
Okay, for some reason, I didn't realize this earlier - you're using a legacy API that doesn't work intuitively/is buggy. Since you are using the API, and know the file URL, you can just hit the endpoint directly: f = requests.get(f'https://domain.com/{fileName}', headers={ "Authorization": f"token {key}" }) Alternatively, you can also use the |
🎉 This issue has been resolved in version 15.29.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description of the issue
Context information (for bug reports)
Output of
bench version
Steps to reproduce the issue
Observed result
500 - INTERNAL SERVER ERROR
Expected result
Content of file
Stacktrace / full error message
Nothing in Error log doc type.
frappe.log:
Additional information
OS version / distribution,
Frappe
install method, etc.Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered: