From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a file from the internet to the hard drive using LabVIEW

For instance, how would I copy this file to my hard drive:

http://sine.ni.com/images/global/us/logo.gif

Thanks.
0 Kudos
Message 1 of 5
(2,584 Views)


@StanlyKupp wrote:
For instance, how would I copy this file to my hard drive:

http://sine.ni.com/images/global/us/logo.gif

Thanks.




You need VIs to handle the HTTP protocol. The Internet Toolkit (Part of the Enterprise Connectivity Toolset) has those VIs. Also the OpenG Toolkit contains HTTP Vis. Unfortunately they are not yet released as a downloadable package (but variants of them are used extensively in the OpenG Commander). You can access those VIs from the CVS repositery though (http://cvs.sourceforge.net/viewcvs.py/opengtoolkit/http/)

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(2,574 Views)
The easiest "built in" method is to use the DataSocket Read VI, which can grab an arbitrary file via HTTP or FTP as long as you append the string "[text]" to the end of the URL. See the Retrieving an Unformatted Text File via FTP or HTTP Using DataSocket KnowledgeBase entry.

In your case, use the following input for the "connection in" input:

http://sine.ni.com/images/global/us/logo.gif[text]

If you wire a string to the "type (Variant)" input, the output can be written directly to a file.

Regards,
John
0 Kudos
Message 3 of 5
(2,564 Views)
StanlyKupp;

Check the following example. You should easily modify it to download the image to a directory in your hard drive.

How to Display an Image from the Web in LabVIEW

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 4 of 5
(2,557 Views)
You guys are awesome. Problem solved, thanks a lot.
0 Kudos
Message 5 of 5
(2,545 Views)