LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Download big files from the Internet

Solved!
Go to solution

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)?

 

0 Kudos
Message 1 of 7
(4,239 Views)

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).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 7
(4,225 Views)
Please post in your linked thread instead of starting a new discussion. There are already questions about size issues. Let's keep it all in one place. Thanks!
0 Kudos
Message 3 of 7
(4,222 Views)

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.

0 Kudos
Message 4 of 7
(4,171 Views)
Solution
Accepted by topic author partial81

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.

Message 5 of 7
(3,711 Views)

Thank you so much for your reply!
Your code works great!
Thanks for your efforts!

0 Kudos
Message 6 of 7
(3,674 Views)

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

 

0 Kudos
Message 7 of 7
(3,664 Views)