How to find the size of the File in Navision
gmaadhan
Member Posts: 2
Hi All,
is it possible to find the size of the file in Navision?
Senario:
I did a customization for attaching documents. So at the time of selecting a particular file, I just want to know the size of the file to restrict.
any idea....
Thanks
G. Madhan
is it possible to find the size of the file in Navision?
Senario:
I did a customization for attaching documents. So at the time of selecting a particular file, I just want to know the size of the file to restrict.
any idea....
Thanks
G. Madhan
0
Comments
-
Have a look at the virtual table called "file". Its behaviour is like a common table, but it is virtual and represents the file system.
Hope this helps
Thomas0 -
Hi G. Madhan,
If I understand you correctly - are you asking what the maximum file size that can be store in Nav. If so and assuming you are storing as a blob.
From the help:BLOB
A BLOB (Binary Large Object) is a complex data type. Variables of this data type differ from normal numeric and string variables in that BLOBs have a variable length.
The maximum size of a BLOB is normally determined by your system's disk storage capacity. However, the maximum size in C/SIDE is 2GB.
Another solution is to store a link to the document in the record link table and hyperlink to it to view.
Hope this helps.0 -
Hi, gmaadhan
Did you find the solution for the file size?
Here I have also the same problem. I want to store the Imported file
size in the table field. So Please help me regarding this issue if you can.
Thanks in Adv.0 -
Getting the size of a file isn't too difficult :
PROCEDURE GetFileSize@1000000000(FileName@1000000000 : Text[1024]) FileSize : Integer; VAR InFile@1000000001 : File; BEGIN InFile.OPEN(FileName) ; FileSize := InFile.LEN ; InFile.CLOSE ; END;0 -
LEN (File)
Use this function to return the length of an ASCII or binary file.
Length := File.LEN
Length
Data type: integer
This tells you the length of the file in bytes.
File
Data type: file
Use this variable to refer to the file.
Good Luck
MCSD
Attain Navision0 -
Thank You very much to you all.
Actually I wanted to make my code More efficient. So I did this post.
The code which I had written was...
FileG.RESET;
FileG.SETRANGE(Path,FlPath);
FileG.SETRANGE("Is a file",TRUE);
FileG.SETFILTER(Name,'%1','*.*');
IF FileG.FINDFIRST THEN BEGIN
REPEAT
IF FileG.Name = FlName THEN
"File Size" := FileG.Size;
UNTIL FileG.NEXT = 0;
END;
Using it I was able to satisfy my requirement..
But the code which you wrote works very well and also very efficient...
Thanks a Lot.

0 -
Thanks for this post, =D>
also added, when using File variable always CLOSE it in the end of process..
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions