Results 1 to 2 of 2

Thread: Inet and Windows 2000

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316

    Arrow

    Is there a problem using Inet with Windows 2000?

    I was attempting to use the following code with no success:

    Code:
    Private Sub cmdSend_Click()
    
    Dim strFileName As String, strFileTitle As String
    strFileName = CommonDialog1.FileName
    strFileTitle = CommonDialog1.FileTitle
    
    With Inet1
            .Protocol = icFTP
            .URL = "xxx.xxx.xxx.xxx"
            .UserName = "xxx"
            .Password = "xxx"
            .Execute , "PUT " & strFileName & " " & strFileTitle
        End With
    
    End Sub
    However, this piece of code worked:

    Code:
    Private Sub cmdSend_Click()
    
    With Inet1
            .Protocol = icFTP
            .URL = "xxx.xxx.xxx.xxx"
            .UserName = "xxx"
            .Password = "xxx"
            .Execute , "PUT C:\Test.txt Test.txt"
        End With
    
    End Sub
    This code does not work either:

    Code:
    Private Sub cmdSend_Click()
    
    Dim strFileName As String, strFileTitle As String
    strFileName = CommonDialog1.FileName
    strFileTitle = CommonDialog1.FileTitle
    
    With Inet1
            .Protocol = icFTP
            .URL = "xxx.xxx.xxx.xxx"
            .UserName = "xxx"
            .Password = "xxx"
            .Execute , "PUT " & "'" & strFileName & "'" & " " & "'" & strFileTitle & "'"
        End With
    
    End Sub
    Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123
    Sorry my bad english :-)
    if strFileName include space-mark, like this:
    C:\My Files\test.txt THIS NOT WORK!!!

    Try this way:

    "PUT ""C:\MY PROGRAMS\ME.JPG"" ME.JPG" should also work

    Or you could convert it to a short path:

    Option Explicit
    Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

    Private Const MAX_PATH As Long = 260

    Private Function GetShortPath(sLongPath As String) As String

    Dim sBuffer As String
    Dim lRet As Long

    sBuffer = Space$(MAX_PATH)
    lRet = GetShortPathName(sLongPath, sBuffer, MAX_PATH)
    sBuffer = Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)

    End Function


    Private Sub Command1_Click()

    MsgBox GetShortPath("C:\Program Files")

    End Sub

    I hope this helps you...
    - Dj4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width