Adding file handler

This commit is contained in:
Kevin Chung
2016-11-05 00:54:21 -04:00
parent 11e3ef66b4
commit 52ad396db4
7 changed files with 36 additions and 17 deletions

View File

@@ -235,7 +235,7 @@ if __name__ == '__main__':
chal = random.randint(1, CHAL_AMOUNT)
filename = gen_file()
md5hash = hashlib.md5(filename).hexdigest()
db.session.add(Files(chal, os.path.join('static/uploads', md5hash, filename)))
db.session.add(Files(chal, md5hash + '/' + filename))
db.session.commit()
### Generating Users