473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I know when a client loaded FTP file is complete?

I have a vb.net app that is using FileSystemWatcher to fire an event
when a file is uploaded by the client via FTP. The app needs to wait
until the upload is complete then perform actions on the uploaded file.
When I use file.exists, it returns true even before the file is
complete.
The file attribute (size) = (the completed file size); and attribute
(normal) = (normal) even before the file upload is complete.
I would greatly appreciate any suggestions for this.

Jan 22 '07 #1
2 3411
josh,

my initial thought would be to try and rename the file, then read the file.
If the file upload is still in progress, you will get an exception on the
rename. Then sleep and try again later. I don't know of a fancier, api way
to tell if the file is busy.

jeff

"Josh" <jo************@comcast.netwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
>I have a vb.net app that is using FileSystemWatcher to fire an event
when a file is uploaded by the client via FTP. The app needs to wait
until the upload is complete then perform actions on the uploaded file.
When I use file.exists, it returns true even before the file is
complete.
The file attribute (size) = (the completed file size); and attribute
(normal) = (normal) even before the file upload is complete.
I would greatly appreciate any suggestions for this.

Jan 23 '07 #2
Thank you, that worked great...

On Jan 22, 11:07 pm, "Jeff Jarrell" <jjarrel_NOS...@yahoo.comwrote:
josh,

my initial thought would be to try and rename the file, then read the file.
If the file upload is still in progress, you will get an exception on the
rename. Then sleep and try again later. I don't know of a fancier, api way
to tell if the file is busy.

jeff

"Josh" <joshua.ocon...@comcast.netwrote in messagenews:11**********************@11g2000cwr.go oglegroups.com...
I have a vb.net app that is using FileSystemWatcher to fire an event
when a file is uploaded by the client via FTP. The app needs to wait
until the upload is complete then perform actions on the uploaded file.
When I use file.exists, it returns true even before the file is
complete.
The file attribute (size) = (the completed file size); and attribute
(normal) = (normal) even before the file upload is complete.
I would greatly appreciate any suggestions for this.- Hide quoted text -- Show quoted text -
Jan 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
3
by: Roy Wang | last post by:
hi, My problem is how to determining when the XML file has loaded using javascript. I loaded an xml file using javascript in a web page. The code below is loading the xml file for IE:...
10
by: Roland | last post by:
Hello, the example code is the following(the number in parentheses at the beginning are just for reference)(The complete HTML file is at the end of this article): (1)window.location =...
5
by: aladdinm1 | last post by:
Hi All, I have an annoying trouble with binary serialization. I have a windows forms application which works like a server and keeps sending data to its clients. The data is serialized before...
3
by: Shmulik | last post by:
I have an application written in C# that creates a queue of items to process, connects via a TCP connection to a server on a Unix box, and then passes data files to the Unix box for processing...
2
by: moondaddy | last post by:
I need to get the size on an image client side before the client uploads it, and if its too large, I need to alert the client rather than doing a postback. The code below successfully writes the...
6
by: adolf garlic | last post by:
A postback I'm doing takes ages to get the data which it then uses to populate a table. What I want to know is: How can I get the client side to fire a 'resize' event when the postback thing...
8
by: Ray5531 | last post by:
Hi All, I got the following Error when I try to run my ASP.NET app ,hosted by IIS 5.1 in windows xp. Event Type: Error Event Source: ASP.NET 1.1.4322.0 Event Category: None Event ID: 1000...
5
by: thisis | last post by:
Hi All, Hi All, (this is not the same topic as the my previous topic) What objects/methods/properties does VBScript offer for: Assuring/guarantee/make certain that ASP/VBSCript an ELEMENT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.