mirror of
https://github.com/jackeilles/xygt.git
synced 2024-11-24 07:42:38 +01:00
fix issue with filesize not being calculated
This commit is contained in:
parent
4aa24345fc
commit
c37a52b2bf
1 changed files with 3 additions and 1 deletions
|
@ -26,7 +26,9 @@ def uploadFile(file, ip, userid, filename, id, retention):
|
||||||
userid = 0
|
userid = 0
|
||||||
|
|
||||||
# Calculate retention before the file is written, we'll grab the filesize here as it's needed for the equation.
|
# Calculate retention before the file is written, we'll grab the filesize here as it's needed for the equation.
|
||||||
fileSize = round(float(file.content_length) / 1024, 2)
|
file.seek(0, os.SEEK_END)
|
||||||
|
fileSize = round(float(file.tell()) / 1024, 2)
|
||||||
|
print(fileSize)
|
||||||
|
|
||||||
if retention == None:
|
if retention == None:
|
||||||
retention = (Config.minretention+(-Config.maxretention + Config.minretention)*pow((fileSize / Config.maxFileSize -1), 3))
|
retention = (Config.minretention+(-Config.maxretention + Config.minretention)*pow((fileSize / Config.maxFileSize -1), 3))
|
||||||
|
|
Loading…
Reference in a new issue