diff options
author | lltommy | 2020-04-13 02:38:26 +0200 |
---|---|---|
committer | lltommy | 2020-04-13 02:38:26 +0200 |
commit | 51fc61bae3ed2eae9719c1aabf959d47468724b2 (patch) | |
tree | 84c64e07db46034d88b1b48e033138b64ccc1f79 /bh20simplewebuploader/main.py | |
parent | bc62d3f4c9ed8d94e536d2dd67fedf40b3e011ab (diff) | |
parent | aa93ecf387182896e6dc84bdd145ebce9aba3745 (diff) | |
download | bh20-seq-resource-51fc61bae3ed2eae9719c1aabf959d47468724b2.tar.gz bh20-seq-resource-51fc61bae3ed2eae9719c1aabf959d47468724b2.tar.lz bh20-seq-resource-51fc61bae3ed2eae9719c1aabf959d47468724b2.zip |
Merge branch 'master' of https://github.com/arvados/bh20-seq-resource
Diffstat (limited to 'bh20simplewebuploader/main.py')
-rw-r--r-- | bh20simplewebuploader/main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index bfc7762..383ef84 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -184,15 +184,17 @@ def receive_files(): # We're going to work in one directory per request dest_dir = tempfile.mkdtemp() + # The uploader will happily accept a FASTQ with this name fasta_dest = os.path.join(dest_dir, 'fasta.fa') metadata_dest = os.path.join(dest_dir, 'metadata.json') try: if 'fasta' not in request.files: return (render_template('error.html', - error_message="You did not include a FASTA file."), 403) + error_message="You did not include a FASTA or FASTQ file."), 403) try: with open(fasta_dest, 'wb') as out_stream: - copy_with_limit(request.files.get('fasta').stream, out_stream) + # Use a plausible file size limit for a little FASTQ + copy_with_limit(request.files.get('fasta').stream, out_stream, limit=50*1024*1024) except FileTooBigError as e: # Delegate to the 413 error handler return handle_large_file(e) |