How To Use Long File Names with the Internet Transfer Control Execute Method (263839)



The information in this article applies to:

  • Microsoft Visual Basic Learning Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP3

This article was previously published under Q263839

SUMMARY

The Internet Transfer control implements two widely used Internet protocols: the HyperText Transfer Protocol (HTTP) and the File Transfer Protocol (FTP). You can use the Internet Transfer control to connect to any site that uses one of these protocols, and you can use the Execute method to retrieve files.

You can also use the GET command with the Execute method to copy files from a FTP site to a local hard disk drive. However, the command does not natively support a destination folder that has long file names and spaces within the path. The command executes but does not send the GET command to the FTP server. This article describes how you can save a file that has a long file name and spaces within the path from an FTP site to a local folder.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site: To save a file from the FTP site to a local folder, use the following code:
Private Sub Command1_Click()
    Inet1.UserName = "Username"
    Inet1.Password = "Password"
    Inet1.URL = "ftp://YourFTPServer"
    Inet1.Execute , "GET testfile.txt " & Chr(34) & "C:\Program Files\LongFileName.txt" & Chr(34)
End Sub
				

Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbhowto kbITC KB263839