mystica
05-27-2009, 01:07 AM
Hi everyone,
I'm trying to figure out a way to integrate a type of download-counter into my application.
I don't need to actually count the number of downloads nor measure bandwidth-useage like a standard download-counter ... but rather ... what I'm seeking to do, is to get my application to measure the size of files downloaded with it, and to keep a tally of the number of megabytes downloaded with it.
Originally, I was figuring on getting my application to do a search for downloaded-files via an Input.GetText function followed by a File.Find and File.GetAttributes function and then read the results into memory and upload them to a remote server.
However, this seems clumsy. It would be slow if the application had to search all of the user's hard-drives to find the downloaded-file, and I can envisage other problems (ie. what if the user saves the downloaded-file under a different name to what they entered in my application's Input Box?)
So instead, I started to think along the lines of getting my application to communicate with some kind of PHP file which could measure the size of the downloaded-files. But my knowledge of PHP is pretty sketchy and I'm having a hard time trying to envisage if this is even possible???
Does anyone have some ideas to toss around?
PS.
I should probably add, that my application uses the the Web-Object together with an InputBox, to do the downloading ... so it goes through the IE-Explorer interface. It does not use the more direct HTTP.Download function.
I'm trying to figure out a way to integrate a type of download-counter into my application.
I don't need to actually count the number of downloads nor measure bandwidth-useage like a standard download-counter ... but rather ... what I'm seeking to do, is to get my application to measure the size of files downloaded with it, and to keep a tally of the number of megabytes downloaded with it.
Originally, I was figuring on getting my application to do a search for downloaded-files via an Input.GetText function followed by a File.Find and File.GetAttributes function and then read the results into memory and upload them to a remote server.
However, this seems clumsy. It would be slow if the application had to search all of the user's hard-drives to find the downloaded-file, and I can envisage other problems (ie. what if the user saves the downloaded-file under a different name to what they entered in my application's Input Box?)
So instead, I started to think along the lines of getting my application to communicate with some kind of PHP file which could measure the size of the downloaded-files. But my knowledge of PHP is pretty sketchy and I'm having a hard time trying to envisage if this is even possible???
Does anyone have some ideas to toss around?
PS.
I should probably add, that my application uses the the Web-Object together with an InputBox, to do the downloading ... so it goes through the IE-Explorer interface. It does not use the more direct HTTP.Download function.