Example Code

Save File from URL to Disk

Code and Documents

Attachment

Download All

Overview
This example demonstrates the use of the LabVIEW to save files from the URL to disk.

 


Description
LabVIEW has the ability to embed Internet Explorer windows in the VI Front Panel. The web browser is part of a ActiveX container. ActiveX containers expose their own Methods and Properties. For example, if an image exists on a web page in Internet Explorer, a user could right-click and select 'Save As..' to save the file to the hard drive. The 'Save As...' action is a Method of Internet Explorer, which means that is exposed to LabVIEW.This example calls the 'Save As...' function of the URL being passed into a the Web Browser ActiveX container on the Front Panel and calls the default Windows action for that file type.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Enter a URL above. Most useful if it is a direct URL to a file in a web directory.
  2. Click Run.
  3. Follow the Windows prompt to save the file to preferred directory.

 

Additional Information or References
VI Snippet

 Block Diagram.PNG

 **This document has been updated to meet the current required format for the NI Code Exchange.**

George T.
Senior Applications Engineer
National Instruments UK and Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Kim_Pierson
Member
Member
on

Isn't this an ActiveX instead of .Net?

Dr. Kim W. Pierson
gt3000
NI Employee (retired)
on

Hello Kim,

That is a good observation.  The technology being employed is ActiveX.  I believe it was a late night oversight.  I will try and update the description above.

Regards,

gt3000

George T.
Senior Applications Engineer
National Instruments UK and Ireland