Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Checking size of a file on disk

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Junior - 28 Jul 2005 19:35 GMT
Hi -experimenting with FTP/Download of files using Access - i've been able
to get the FTP.exe working but i'm using txtboxes to capture the
filename,username,password, etc.
and it is possible to download an empty file from the FTP server, if
incorrect data is entered in the txt boxes.
I'd like to check the file size to be sure it isn't empty before proceeding
to the next step.
Dirk Goldgar - 28 Jul 2005 19:58 GMT
> Hi -experimenting with FTP/Download of files using Access - i've been
> able to get the FTP.exe working but i'm using txtboxes to capture the
[quoted text clipped - 3 lines]
> I'd like to check the file size to be sure it isn't empty before
> proceeding to the next step.

You can use the FileLen function to get the size.  See the help file for
details.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Junior - 29 Jul 2005 05:12 GMT
Dirk - thanks - i tried FileLen(path) - but always returns a zero - i've
used it to evaluate several files of known size
is there a 'trick' to using FileLen or some reference i possible don't have
Access2K, WinXP

>> Hi -experimenting with FTP/Download of files using Access - i've been
>> able to get the FTP.exe working but i'm using txtboxes to capture the
[quoted text clipped - 6 lines]
> You can use the FileLen function to get the size.  See the help file for
> details.
Dirk Goldgar - 29 Jul 2005 14:47 GMT
> Dirk - thanks - i tried FileLen(path) - but always returns a zero -
> i've used it to evaluate several files of known size
> is there a 'trick' to using FileLen or some reference i possible
> don't have Access2K, WinXP

Do you mean that it appears to work properly when you use it to check an
existing file, but it always returns 0 in the circumstances in which
you're using it?  The most likely cause of that is that the download
process has only begun, not finished, at the time when you call FileLen.
That seems quite likely if you're using the command-line FTP.EXE
utility, since that would not be in any way synchronized with your code.

The most common way to synchronize with a utility of this sort is to
start the utility and then enter a timing loop that repeatedly checks
the target file to see if it has more than 0 bytes, indicating that the
utility has finished.  But that's not going to work in your case,
because you'll get a 0-byte target file if the source file isn't there
at all.

I imagine that you could work around this by first downloading the
source directory into a file, checking that file to make sure the file
you want to download exists, and only then downloading the file.
However, working with the command-line utility is cumbersome.  You could
get finer control, and avoid the synchronization problem entirely, by
using a different FTP mechanism.  For example, you could use Dev
Ashish's Internet Data Transfer Transfer Library:

   http://www.mvps.org/access/modules/mdl0037.htm
   Modules: Internet Data Transfer Library

And there's another freeware FTP utility called Chilkat FTP -- I don't
have the URL handy, but I'm sure you could find it on the web -- that
others have used with great success.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.