Skip to content
Snippets Groups Projects
Commit 807cfbf9 authored by Marco De Donno's avatar Marco De Donno
Browse files

Call the process function by default when a file is uploaded

parent ca788009
Branches
No related tags found
No related merge requests found
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from NIST.fingerprint import NISTf_auto
def process( wd, filename ):
n = NISTf_auto( wd + "/" + filename )
############################################################################
# Data export
with open( wd + "/data.txt", "w+" ) as fp:
fp.write( str( n ) )
......@@ -3,12 +3,15 @@
from flask import *
from flask_compress import Compress
from threading import Thread
from werkzeug import *
import logging
import os
import tempfile
from functions import *
################################################################################
logging.getLogger().setLevel( logging.INFO )
......@@ -63,6 +66,8 @@ def upload_file():
filename = secure_filename( file.filename )
file.save( os.path.join( UPLOAD_FOLDER, filename ) )
Thread( target = process, args = ( UPLOAD_FOLDER, filename ) ).start()
return jsonify( { 'error': False, 'file': filename } )
################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment