Skip to content

Commit

Permalink
Add support for xlsx file, #8469
Browse files Browse the repository at this point in the history
  • Loading branch information
njkim committed Jul 19, 2023
1 parent 8c4e162 commit 9134337
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions arches/app/etl_modules/branch_csv_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ def read(self, request):
result["summary"]["files"][file.filename] = {"size": (self.filesize_format(file.file_size))}
result["summary"]["cumulative_excel_files_size"] = self.cumulative_excel_files_size
default_storage.save(os.path.join(self.temp_dir, file.filename), File(zip_ref.open(file)))
elif content.name.split(".")[-1] == "xlsx":
self.cumulative_excel_files_size += content.size
result["summary"]["files"][content.name] = {"size": (self.filesize_format(content.size))}
result["summary"]["cumulative_excel_files_size"] = self.cumulative_excel_files_size
default_storage.save(os.path.join(self.temp_dir, content.name), File(content))
return {"success": result, "data": result}

def start(self, request):
Expand Down
2 changes: 1 addition & 1 deletion arches/app/templates/javascript.htm
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
download-templates='{% trans "Download Templates" as downloadTemplates %} "{{ downloadTemplates|escapejs }}"'
select-template='{% trans "Select Template" as selectTemplate %} "{{ selectTemplate|escapejs }}"'
upload-zip-file='{% trans "Upload .zip File" as uploadZipFile %} "{{ uploadZipFile|escapejs }}"'
upload-your-zip-file='{% trans "Upload Your .zip File" as uploadYourZipFile %} "{{ uploadYourZipFile|escapejs }}"'
upload-your-xlsx-zip-file='{% trans "Upload Your .xlsx or .zip File" as uploadYourXlsxZipFile %} "{{ uploadYourXlsxZipFile|escapejs }}"'
branch-excel='{% trans "Branch Excel" as branchExcel %} "{{ branchExcel|escapejs }}"'
file-upload-summary='{% trans "File Upload Summary" as fileUploadSummary %} "{{ fileUploadSummary|escapejs }}"'
file='{% trans "File" as file %} "{{ file|escapejs }}"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h4>
<span><i style="color: #000" class="fa fa-cloud-upload r-select-icon"></i></span>
</div>
<h2>
<span data-bind="text: $root.translations.uploadYourZipFile"></span>
<span data-bind="text: $root.translations.uploadYourXlsxZipFile"></span>
</h2>
<h4>
<span data-bind="text: $root.translations.dragAndDropFilesOnPanel"></span>
Expand Down

0 comments on commit 9134337

Please sign in to comment.