Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Unable to Use DataSocket to Connect to an FTP Site That Requires a Username and Password

Primary Software: Other NI Software>>DataSocket
Primary Software Version: 4.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: I am trying to connect to an FTP server that requires a username and password. I have already read the KnowledgeBase entitled How Can I Retrieve Data from FTP Servers That Require a Username and Password for Login?, but I still cannot retrieve a text file from my server. DataSocket seems to connect and disconnect without retrieving my data.

Solution: It is important to note that the URL passed to DataSocket is interpreted as an absolute path, not a relative path.

For example, my FTP Server is a UNIX machine named "unixbox.somewhere.com". My login name is "joeuser" and my password is "abc123". I store files in a directory called "/export/home/joeuser". If I login to the machine using command-line FTP, I can easily download a file named "test.txt" by specifying "get test.txt", but I cannot supply the following URL to DataSocket, because it will not work:
    ftp://joeuser:abc123@unixbox.somewhere.com/test.txt
DataSocket will try to download "/test.txt" which does not exist (note the forward slash).

To download the file successfully, I must use this URL:
    ftp://joeuser:abc123@unixbox.somewhere.com/export/home/joeuser/test.txt


Related Links: KnowledgeBase DIRECT-45GPFL: How Can I Retrieve Data from FTP Servers That Require a Username and Password for Login?

Attachments:





Report Date: 05/07/2001
Last Updated: 09/14/2004
Document ID: 296FT5A6

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit