08-24-2016 12:45 PM
I found here the attached program "Downloader" for downloading files from the internet.
The program works well as long as the file is not too big (bigger than about 30 MB, perhaps even smaller).
If the file is bigger, no file is safed.
Can somebody help me to rewrite this program so that it works also for bigger files (up to 100 MB)?
Solved! Go to Solution.
08-24-2016 01:00 PM
If you want to download larger files, you will probably need to stream the file to disk, rather than download it and write it all in one go.
To do this in LabVIEW, you will need to read 'chunks' of the file - either using TCP/IP, or you could a .NET library to do it for you. I would probably go with the .NET option, as it will probably have functionality to allow you get the download status and to be able to cancel the download if it's taking too long.
You could also try using the HTTP Client VIs as they have an option to write to write the data directly to disk (at least I think that's what the 'output file' option is for).
08-24-2016 01:02 PM
08-24-2016 04:29 PM
Dear Sam_Sharp,
Thanks for these suggestions. I already tried to read chunks of the file. But it still does not work (could be also an error in my program).
I hope somebody can give me a similar code as the posted one in which reading of chunks is used correctly. This would be a perfect solution for me because I understand the posted code very well and could adapt it so far well to my actual problem.
Dear altenbach,
I can understand your point. But the discussion I am referring to started in 2005. In 2012 the problem of big files was mentioned. Nobody posted a solution. I could also not find a solution in the forum here which works for me. For sure it could be, that I oversaw something. If so, then I would be happy to get a link to the solution.
04-18-2017 04:07 AM
To download a big file via http, you need to use the Range header keyword in the GET request, to partially download a file.
Example of header HTTP:
"Range: bytes=0-99"
to download the first 100 bytes
Take a look a complete example in the zip file.
04-24-2017 09:09 AM
Thank you so much for your reply!
Your code works great!
Thanks for your efforts!
04-24-2017 09:53 AM
Dear Partial81,
many thanks for your reply!
you could also find an update of these VIs, with some additional feature at this link
http://forums.ni.com/t5/LabVIEW/Buffered-Downloading-of-a-File-using-a-URL/m-p/3614422#M1013371