Excel File Size
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
4 posts
Page 1 of 1
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
You can retrieve the file size by doing something like the following:
For more information, please see the help text (Blue Question Mark within your GoAnywhere Director) and search for FileInfo.
Code: Select all
The output from this would show:<project name="FileInfo Test" mainModule="Main" version="2.0" logLevel="silent" threadSafe="true">
<module name="Main">
<print label="Display File Size" version="1.0">
<![CDATA[
===================================================
File Name: ${ MyFile }
File Size: ${ FileInfo( MyFile ):size }
===================================================
]]>
</print>
</module>
<variable name="MyFile" value="" />
</project>
Code: Select all
In this example, I'm passing the file location in as a parameter (MyFile). You could easily assign the file name within your project, or define it as a literal location. 01/11/2013 09:28:25 INFO Overriding variable 'MyFile' with value 'C:\Temp\MyZipFile.zip'
01/11/2013 09:28:25 INFO
===================================================
File Name: C:\Temp\MyZipFile.zip
File Size: 21045
===================================================
01/11/2013 09:28:25 INFO End Date and Time: 01/11/2013 09:28:25
For more information, please see the help text (Blue Question Mark within your GoAnywhere Director) and search for FileInfo.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Ric,
Thanks for your response. I must be missing something though because I can't seem to get it to work. Here is a sample of what I am trying to do:
Thanks for your response. I must be missing something though because I can't seem to get it to work. Here is a sample of what I am trying to do:
Code: Select all
The .zip file was generated in the projects workspace. The variable FileSize always seems to be set to Zero (0). <setVariable label="Set File Name" name="MyFile" value="BatchEstimatedCartonizing${userid}${jobnbr}.zip" version="2.0" />
<setVariable label="Set File Size" name="FileSize" value="${ FileInfo( MyFile ):size}" version="2.0" />
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Try this:
Code: Select all
Which generates this:<project name="FileInfo Test" mainModule="Main" version="2.0">
<module name="Main">
<createWorkspace version="1.0" />
<setVariable label="Init MyZipFile" name="MyZipFile" value="${system.job.workspace}/Pics.zip" version="2.0" />
<zip label="Zip my Files" outputFile="${ MyZipFile }" whenFileExists="overwrite" version="1.0">
<fileset dir="C:\Temp">
<wildcardFilter>
<include pattern="*.jpg" />
</wildcardFilter>
</fileset>
</zip>
<print label="Display File Size" version="1.0">
<![CDATA[===================================================
File Name: ${ MyZipFile }
File Size: ${ FileInfo( MyZipFile ):size }
===================================================
]]>
</print>
<deleteWorkspace version="1.0" />
</module>
</project>
Code: Select all
If you're still having issues, please email us at [email protected] or call our Support Help line!01/11/2013 10:58:22 INFO Start Date and Time: 01/11/2013 10:58:22
01/11/2013 10:58:22 INFO Job Number: 1357908022166
01/11/2013 10:58:22 INFO Project Name: /Projects/FileInfo Test
01/11/2013 10:58:22 INFO Submitted By: RElliott
01/11/2013 10:58:22 INFO GoAnywhere Director 4.2.0 running on Windows 7 6.1 (amd64)
01/11/2013 10:58:22 INFO ===================================================
File Name: C:\Program Files\Linoma Software\GoAnywhere\userdata\workspace\1357908022166/Pics.zip
File Size: 1819758
===================================================
01/11/2013 10:58:22 INFO End Date and Time: 01/11/2013 10:58:22
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
4 posts
Page 1 of 1