File tree Expand file tree Collapse file tree
public/js/frappe/file_uploader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def upload_file():
165165 file = files ["file" ]
166166 filename = file .filename
167167
168- if frappe .form_dict .chunk_index :
168+ if frappe .form_dict .get ( " chunk_index" ) is not None :
169169 current_chunk = int (frappe .form_dict .chunk_index )
170170 total_chunks = int (frappe .form_dict .total_chunk_count )
171171 offset = int (frappe .form_dict .chunk_byte_offset )
Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ function return_as_dataurl() {
571571async function upload_file (file , i ) {
572572 currently_uploading .value = i;
573573
574- const CHUNK_SIZE = frappe .boot .file_chunk_size ;
574+ const CHUNK_SIZE = frappe .boot .file_chunk_size || 25 * 1024 * 1024 ;
575575
576576 const use_chunks = file .file_obj && file .file_obj .size > CHUNK_SIZE ;
577577 const total_chunks = use_chunks ? Math .ceil (file .file_obj .size / CHUNK_SIZE ) : 1 ;
@@ -685,7 +685,6 @@ async function upload_file(file, i) {
685685 xhr .setRequestHeader (" X-Frappe-CSRF-Token" , frappe .csrf_token );
686686
687687 let form_data = new FormData ();
688-
689688 if (chunk_blob) {
690689 form_data .append (" file" , chunk_blob, file .name );
691690 }
You can’t perform that action at this time.
0 commit comments