LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Download file from web server via remote panel

I have a VI running and published on the Labview web server (the machine is a Fieldpoint but i think it doesn't matter).

I'm controlling the VI from a remote web browser. I would like to start a file download from the VI, for example when i click a link or a button on the remote panel, just like when you click "download" on a standard web page. The file is in the web server root of the server machine, and i can download it fine if i enter http://ip-address/filename manually; can i trigger the download from the remote panel?

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

Hi Snamproge...,

you can use the DataSocket vi's or you use the HTTP commands as shown in this thread.

 

Hope it helps.

Mike

Message 2 of 7
(4,060 Views)
That's just a VI that runs locally and downloads stuff locally from a website. Not a VI embedded in a remote panel
0 Kudos
Message 3 of 7
(4,058 Views)

Hi Snamproge...,

sorry, now i think i understand what you want.

I think you can only start i process which finds out which computer is connected and copy the file to an enabled folder of this pc.

 

Mike

Message 4 of 7
(4,056 Views)

There are problems with the approach you are taking to this. The VI that you are controlling through remote panels is executing only on the server. The front panel you interact with in the browser only does UI work. Therefore, the executing VI has absolutely no way of interacting with the computer that is controlling the remote panel. It is not possible to click a button on the VI and force the client browser to initiate a download.

 

There are couple ways you could go about this. The easy way would be to simply put the link in the HTML page instead of on the VI front panel. This would be trivial to implement- the downside being that it might not be what you want cosmetically.

 

There is another approach that would be very complicated to implement and so I wouldn't recommend it. You could embed javascript code in the HTML page that regularly queries the web server for the file. When the button on the VI was pressed the VI could copy the file to the correct directory, similar to what MikeS81 suggested above, and the next time the browser polled the server it would do the download. This would require a javascript enabled web browser (as well as a javascript expert to write it) and could have poor performance depending on your network.

 

Let me know if I completely misunderstood your question. 🙂

 

Nathan

Message Edited by NathanK on 01-21-2009 10:37 AM
Message 5 of 7
(4,038 Views)

Yes you understood perfectly.

I think another solution is to embed a HTML page, containing only the file link, within the VI. On a Windows server it can be done with ActiveX; but as far as i know it can't be done on a Fieldpoint or cRIO

0 Kudos
Message 6 of 7
(4,015 Views)

ActiveX is a windows thing so you're right that it isn't available on RT.

 

The ActiveX container in LabVIEW basically just gives the contained application a space to draw itself. For example when you embed IE on a VI's front panel it is IE and not LabVIEW that is doing the drawing and event handling inside that control.

 

For this reason ActiveX controls cannot be used with remote panels. LabVIEW can't proxy the drawing and events for the contained application over the remote panel protocol. Sorry for being so negative all the time. 🙂

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