LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to copya file to a FTP server

hello
could you tell me how copy a file to a FTP server please
I use ds_open to connectmyFTP (with adress ftp://login:password@ftp.domain.com)
and I use copyfile to copy a file fromlocal to ftp server but itdoesn'tseem to work
please tellme how do it
thanx
0 Kudos
Message 1 of 8
(4,985 Views)
It sounds like you are trying to mix methods. You can write a file to an FTP server with DataSocket, OR you can use FTP commands (included with CVI's internet toolkit). If you want to use DataSocket, you would:

1) Use DS_Open to open a connection to the FTP file like ftp://login:password@ftp.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

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 8
(4,985 Views)

Hi, I have FTP server running on PC1 and i want to read file from that PC1 from PC2(FTP Client) with userID and password. How i have to go. I have LWCVI 6.0.

--Vishnu

 



Message Edited by Vishnu Patel on 07-01-2008 11:47 PM
0 Kudos
Message 3 of 8
(4,565 Views)

Hi Vishnu,

These two knowledgeable articles might be of some assistance.
Essentially, you will use DataSockets to connect to the FTP server, and embed the username/password in the URL.

Writing Data to an FTP Server in CVI Using Datasocket
How Can I Retrieve Data from FTP Servers That Require a Username and Password for Login?

Nestor
0 Kudos
Message 4 of 8
(4,525 Views)

Dear Nestor,

          Thanks for support. but by using idea in the link provided is not working for me. I don't know what is the reson. :

As given in examle that with userid and PWD. i have to write in below method

ftp://joe:123456@ftp.ni.com/support/compworks/datasocket/tone.wav

but i could n't connect. In my case my server IP address is 202.41.112.98 and userid and password for ftp is "ayus" and "ayus".  I wrote

ftp://ayus:ayus@202.41.112.98

for browsing home folder i couldn't.

I had tried to logon on FTP server by dos command as well as internet explorer.

 

What mistake i am doing.

 

--Vishnu

0 Kudos
Message 5 of 8
(4,476 Views)

I have WFTPD ftp server. How i can make userid-passwork based ftp client in LabWindows/CVI 6.0

--Vishnu

0 Kudos
Message 6 of 8
(4,472 Views)
Hello Vishnu,

When you tried to log in to your FTP server using Internet Explorer did it work?

Also, I found this FAQ document for WFTPD:
http://www.wftpd.com/faq.htm#Browser

One of the things it mentions is also specifying a port when trying to connect, have you tried doing that?

Kristen
National Instruments
0 Kudos
Message 7 of 8
(4,451 Views)

Dear Kristen,

         FTP server loging with internet explorer didn't work. I will try with link provided by you. Thanks

--Vishnu

0 Kudos
Message 8 of 8
(4,426 Views)