Skip to content

Commit

Permalink
Change get file size
Browse files Browse the repository at this point in the history
  • Loading branch information
blagojabozinovski committed Dec 6, 2023
1 parent 820d814 commit 9dd5847
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/big_resources/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _copy_file_overwriten(input_file, output_file, max_size):
CHUNK_SIZE = int(toolkit.config.get('ckanext.big_resources.chunk_upload', 2048))

max_size_in_mb = max_size*1000000
if len(input_file.read()) > max_size_in_mb:
if os.path.getsize(input_file.name) > max_size_in_mb:
raise logic.ValidationError({'upload': ['File upload too large']})
input_file.seek(0)
while True:
Expand Down

0 comments on commit 9dd5847

Please sign in to comment.