# Read file size

**URL:** <https://forum.inductiveautomation.com/t/read-file-size/2052>\
**Category:** Ignition\
**Created:** [July 19, 2010, 8:57pm UTC](https://forum.inductiveautomation.com/t/read-file-size/2052 "2010-07-19T20:57:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [July 19, 2010, 8:57pm UTC](https://forum.inductiveautomation.com/t/read-file-size/2052/1 "2010-07-19T20:57:57Z")

</div>

Is there any way to read the size of a file? I’m writing code to allow the customer to save attachments (which are saved as BLOBs in the database), but until I actually try to save them I don’t know if they’re going to be too big for the database.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [July 19, 2010, 9:07pm UTC](https://forum.inductiveautomation.com/t/read-file-size/2052/2 "2010-07-19T21:07:49Z")

</div>

Sure:

`from java.io import File
myFile = File("C:\\something.txt")
print "The length is ", myFile.length()`

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [July 19, 2010, 9:47pm UTC](https://forum.inductiveautomation.com/t/read-file-size/2052/3 "2010-07-19T21:47:55Z")

</div>

Just the ticket, Carl. Thanks!
