CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Why is the file not uploaded

    I want to upload a file to a ftp-server in a sub-folder.
    I tried several ways but the file was never uploaded.
    Pls. help

    This is my code:
    Code:
     UploadFile = WgBestandsPad & "\PfDetailVerzendTKP" & frmPfDetailhandel.txtLoonTijdVak(0).text & ".xml"
     RemoteFileName = "PfDetailVerzendTKP" & frmPfDetailhandel.txtLoonTijdVak(0).text & ".xml"
    
    ' I want the remotefile to be placed in the sub-folder: "www.herman.nl\detailhandel"
    
     With Inet1
    	.Protocol = icFTP
    	.RemoteHost = "www.herman.nl"
    	.UserName = "herman123"
    	.Password = "Pwd00000"
    	.Execute .url, "Put " + UploadFile + " " + RemoteFileName
    	Do While .StillExecuting
    	DoEvents
    	Loop
        UploadFile = (.ResponseCode = 0)
    End With

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Why is the file not uploaded

    Not an expert in vb6, but get rid of the chance of errors by temporarily hardcoding the textbox values.

    For example, rather than using the value of 'txtLoonTijdVak(0).text', hardcode the complete string you pass to the inet call.

    Lastly, is the following statement correct?
    Code:
    	.Execute .url, "Put " + UploadFile + " " + RemoteFileName
    In my untrained vb6 eye, the ".Execute .url," part looks strange to me.

    I would expect something more like:
    Code:
    .url = "Put " + UploadFile + " " + RemoteFileName
    .Execute
    Again not a vb6 expert so...
    Last edited by Arjay; January 24th, 2018 at 02:36 AM.

  3. #3
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Re: Why is the file not uploaded

    Thanks Arja for your suggestion.
    However, the problem is still the same

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

Featured