04-11-2015 12:00 PM
Hello,
I am looking for a way to download files from a known location but in a way to have a progress bar of the download. Is it possible?
I've started looking at DataSocket and the http GET vi and I managed to download some files from my Dropbox's Public folder (which has a link), but these VI's put my app in a hanging state until they finish downloading and I don't know how long it should take to finish, particularly if I would start downloading something bigger.
Is there a VI anywhere which provides the progress data periodically? (Optionally speed would be nice as well, however I think, it should be calculated from the progress data and elapsed time.) I am planning to have an updater vi for an app of mine (I hate using USB sticks and copying it to the measurement PC following each update). I wouldn't really care for the progress data, if the files would be <1MB, however I have some bigger files which should take longer to download and a feel of the progress would make it bearable.
Thanks
Solved! Go to Solution.
04-11-2015 12:09 PM
04-13-2015 04:52 PM
@mikeporter wrote:
The ftp VIs maybe?
This is how I've done it in the past. I implemented a modified FTP API which took the NI one and added support for two progress bars, current file and File 1 of N, using a functional global. Also I think my version added cancel support. I started by opening up the NI VIs, and saving a new copy, with a new name, which still had the same low level VI calls NI already wrote.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-14-2015 01:17 AM
Thank you guys, seems like I have to get myself into it and examine the ftp VIs. (Can these FTP vis accept http download as well?)
04-14-2015 02:15 AM
@jeanlucpicard wrote:
Thank you guys, seems like I have to get myself into it and examine the ftp VIs. (Can these FTP vis accept http download as well?)
Of course not! FTP is a completely different (and much simpler) protocol than HTTP.
04-14-2015 02:29 AM
then I should take a look at the inside of the TCP or HTTP vis as well
04-14-2015 04:43 AM
04-14-2015 05:16 AM
That's going to be a dead end unfortunately if you use the NI provided HTTP VIs. While the FTP Vis are implemented fully in LabVIEW, the HTTP functions are only simple wrappers that call into a shared library. There is not much to see in those VIs and nothing to change in the shared library.
Depending on how involved your HTTP communication is, it is however not necessarily difficult to implement something fairly trivial in LabVIEW alone. That is unless you want to support HTTPS, in that case you can forget it. HTTPS support fully implemented in LabVIEW is a complete nonsense.
For normal HTTP you might want to look at OpenG. I remember they used to have a VI, that worked although it was a little crude. Here is the path to the old CVS directory on sourceforge containing the VIs.
04-14-2015 03:32 PM - edited 04-14-2015 03:45 PM
Okay, seems like I've made some progress with modding the FTP vis. (Copying them to a new location almost drove me nuts, but eventually managed it).
Thanks for guiding me into the right direction. Now I just have to ask the IT guys an ftp account for my files 🙂
(I implemented an FTP [SIZE] vi based on other command vis and included an FGV in this file and the TCP Read Stream for the file size and progress data)