Copy link to clipboard
Copied
Does anyone have some code t
hat will work in ColdFusion for tracking the success/failure of file downloads?
I am looking for something similiar to this post for
.NET http://www.codeproject.com/KB/aspnet/Download_Track.aspx
Copy link to clipboard
Copied
AFAIK there is no CFML features that will allow one to do this.
To do anything like what that .NET code seems to do, I believe one will have to tap Java Code. I don't know of any examples, but maybe searching for Java download code that chops up the download into an arbitrary number of packets to try and monitor the download probably exists somewhere. If you can find a Java way to do it, it is usually fairly easy to tap Java functionality with CFML.
Personally, I'm not sure I would want to inconvience my users and the network protocols like that, but the world takes all kinds.
Ian
Copy link to clipboard
Copied
Thanks for your answer. I have looked for Java solutions and
I found something here but it does not work or it does not return
what I am expecting.
The code snippet does in fact have a file.exists call and it is getting back not only the file exists but a second call is getting the right file size. It then loops just like it is supposed to and sends 1024 blocks to the stream however the browser sees 0 bytes.