Results 1 to 9 of 9

Thread: Uploading To FTP

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    30

    Uploading To FTP

    Hi Guys ... I'm triying to make an App to Upload files on FTP..

    but i receive an error which is getting me crazy ...

    Ok this is the code :

    Private Sub Connect_Click()

    With Inet1

    Inet1.AccessType = icUseDefault

    Inet1.Protocol = icFTP

    Inet1.RemoteHost = Text1.Text

    Inet1.RemotePort = Text4.Text

    Inet1.Password = Text3.Text

    Inet1.UserName = Text2.Text

    Inet1.RequestTimeout = "180"

    End With
    End if




    Private Sub Upload_Click()
    Dim strRemote As String
    Dim strLocal As String
    strRemote = Text6.Text
    strLocal = Text5.Text
    Inet1.Execute , "PUT """ & strLocal & """ " & strRemote'Here is the PROBLEM
    End Sub


    Anyone . anyidea how to fix it ?

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading To FTP

    i think like this
    "PUT """ & strlocal & """ """ & strRemote & """
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    30

    Re: Uploading To FTP

    Still Now Working ..:S

    Error : Cannot Connect to the Remote Host

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Uploading To FTP

    An obvious, and possibly stupid question, but one that needs to be asked: are you sure the remote host is available for connection?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    30

    Re: Uploading To FTP

    Yeah , it is available , i'm already Connected to that Host by using SmartFTP

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading To FTP

    you don't show us the code you use to connect
    just the settings and the put
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    30

    Re: Uploading To FTP

    Well i don't have a code like that ...

    Do i must to have it ?

    If Yes ..

    Can you tell me what's that code .. ?

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading To FTP

    yes you need to connect to the ftp server before you can do anything
    i don't use inet control, but try inet.connect
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading To FTP

    here is some sample code, change from get to put
    vb Code:
    1. Inet1.Execute "FTP://ftp.microsoft.com", _
    2. "GET Disclaimer.txt C:\Temp\Disclaimer.txt"
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

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