LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"Need a link to an example that include sending file to URL/IP through HTTP"

I need to send a file to URL through HTTP protocol
I checked all examples but could not find any thing
that can help me.
0 Kudos
Message 1 of 4
(3,576 Views)
Hello Erez,

You can try using the DataSocket in CVI, it provides a simple solution for transferring text files to and from a remote computer. DataSocket can accept a number of transfer protocols including http://, ftp://, and dstp://. There are example programs in LabWindows/CVI that uses DataSocket for communication.

You can use DataSocket with LabVIEW, LabWindows/CVI, ComponentWorks, and Tools for Visual C++ software and can find more information on DataSocket at http://www.ni.com/datasocket/

I hope it helps,
Rajiv
0 Kudos
Message 2 of 4
(3,576 Views)
I know that I need to use DataSocket but I could not
find any example that show how to transfer a file
from my computer to another through HTTP protocol.
If any one have a link to an example please give it.
0 Kudos
Message 3 of 4
(3,576 Views)
Hello Erez,

What more you can do with is copy the contents of the file from your computer to the http location. The steps you need to follow then are:

1) Use DS_Open to open a connection to the HTTP file, for example: http://domain.com/filename.txt
2) Open the local file in CVI with fopen.
3) Read the contents of the local file into a string buffer with fread.
4) Write the string buffer to the DataSocket with DS_Write
5) Close the datasocket connection with DiscardObjHandle

References:
Protocols for DataSocket and DataSocket Server
How Do I Download a T
ext File from a Password Protected URL Using DataSocket Read?


I hope it helps this time,
Rajiv
0 Kudos
Message 4 of 4
(3,576 Views)