Re: How to Monitor the uploading a file using java
- From: "gerrards8@xxxxxxxxx" <gerrards8@xxxxxxxxx>
- Date: Mon, 05 Sep 2005 22:31:52 -0400
Gordon Beaton wrote:
If you can, have the uploading process upload to a different name (an additional suffix will do) or different directory. It can then rename the finished file to the final destination (an atomic operation) where your application detects it and can safely assume that it is complete.
/gordon
That's exactly right.
If the client doesn't have the ability to rename the file, then upload another empty file with a different extension as an indicator that the upload task is now complete. This will be the file you want to monitor (filter your monitor on this 2nd extension).
If none of the above options are feasible, then you would have no option but to monitor the size of the file, and determine an acceptable span of time where if the size doesn't change (within that time period), then a file uploaded event is triggered. (this is *very* ugly, but works if you trust your system/network environment, specially if the constant size time span is large, which would slow down your server's response).
.
- References:
- How to Monitor the uploading a file using java
- From: GMHK
- Re: How to Monitor the uploading a file using java
- From: Gordon Beaton
- How to Monitor the uploading a file using java
- Prev by Date: Re: how to detect a hard link in Java?
- Next by Date: Re: Hair-lines when drawing transformed BufferedImage
- Previous by thread: Re: How to Monitor the uploading a file using java
- Next by thread: Re: How to Monitor the uploading a file using java
- Index(es):
Relevant Pages
|