Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4734 Zobrazení

Hello,

I have a binary field and I would like get the size of this file for prevent the upload.

How can I do ?


Thanks

Avatar
Zrušit
Nejlepší odpověď

How about a function in a custom module? Here's the most relevant part you need 

import os

check_size = os.path.getsize("/path/filename")
print check_size # not needed, is just for a quick dev check.

The rest of the logic depends on what you need to do exactly. 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 25
8885
1
kvě 25
1140
0
led 24
1821
1
úno 22
24009
0
led 22
2861