Odoo Help

1

[V8] Get file size

By
Dorcy Valérian
on 7/16/15, 8:39 AM 610 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

0
FEDERICO LEONI
On 7/17/15, 11:27 AM

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. 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/16/15, 8:39 AM
Seen: 610 times
Last updated: 7/18/15, 9:32 AM