-
January 23rd, 2018, 06:15 AM
#1
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
-
January 24th, 2018, 02:32 AM
#2
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.
-
January 26th, 2018, 05:06 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|