Skip to Content
मेन्यू
This question has been flagged
1 Reply
4739 Views

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
3
जुल॰ 25
8886
1
मई 25
1142
0
जन॰ 24
1821
1
फ़र॰ 22
24012
0
जन॰ 22
2866