In File Manager, I am unable to upload larger files. I do not know what the max that it’s allowing through is.
I have changed the config in System Settings > Files to 5120 MB. I know it’s large, but go big or go home for now.
I have also set CLIENT_MAX_BODY_SIZE environment variable to 5120m and I have confirmed that the nginx configuration in /etc/nginx/conf.d/frappe.conf has client_max_body_size 5120m;, which it does.
I’m using the frappe_docker setup with layered image building and mariadb, redis, and noproxy overrides.
I need to be able to upload videos for the LMS app. I do not have ERPNext installed on the site, which I don’t think should have an impact. I considered using a different override other than noproxy, but I’m not sure what the root of the issue is yet.
Any ideas as to what else could cause this or what I should do to troubleshoot?
I have seen a few other posts on the forum that are related, but they mostly suggest to configure the two pieces I have already configured.
I am using a Cloudflare tunnel, which only allows 100MB through.
Before I find another solution, would it be possible to modify the upload logic so all uploads above a certain configured size are uploaded in chunks on the client side and stored temporarily on the server side? Then the last chunk includes the checksum and the server combines the chunks, calculates the checksum, and if they match, store the file?
It seems with how uploads are currently handled, the logic is within the FileUploader.vue component. There seems to be differing versions of this component between the framework and the apps and frappe-ui.
The gist would make it possible to upload the files, but only through a new “File Uploader” doctype to my understanding. This would add complexity and aggrevation to say adding larger video content to the lms application.
I believe customizing the upload process then would require a modification to either the frappe framework and/or the lms app.
Simplicity for the time being for an internal application for <50 people. I am not ready to port forward. It’s a matter of preference unless I see a significant negative impact due to the additional routing through the tunnel.
I am working on a solution using the gist aforementioned, but attaching the logic to the upload_files method on the FileUploader class on frappe.ui.FileUploader. I am modifying the prototype in a file referenced in the doctype_list_js hook.
// Store the original upload_files method
const originalUploadFiles = frappe.ui.FileUploader.prototype.upload_files;
// Replace upload_files with custom logic
frappe.ui.FileUploader.prototype.upload_files = function() {
// Custom logic
alert("Replaced attempting to Upload Files!");
// Example: Log files being uploaded
console.log('Uploading files:', this.uploader.files);
// Call the original method
return originalUploadFiles.call(this);
};
I will be adding a server side whitelisted endpoint like from the gist, I just haven’t gotten there yet. I believe I will implement this such that it will use the existing process for uploading for files under the chunk size (which i think I will make a site config).
I will have to make sure the script doesnt get ran again and again, so maybe I will have to add a check if I already replaced the method.