|
-
Sep 8th, 2007, 07:19 PM
#1
Thread Starter
Junior Member
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 ?
-
Sep 8th, 2007, 08:27 PM
#2
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
-
Sep 9th, 2007, 04:48 AM
#3
Thread Starter
Junior Member
Re: Uploading To FTP
Still Now Working ..:S
Error : Cannot Connect to the Remote Host
-
Sep 9th, 2007, 05:11 AM
#4
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?
-
Sep 9th, 2007, 05:20 AM
#5
Thread Starter
Junior Member
Re: Uploading To FTP
Yeah , it is available , i'm already Connected to that Host by using SmartFTP
-
Sep 9th, 2007, 08:12 AM
#6
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
-
Sep 10th, 2007, 04:55 PM
#7
Thread Starter
Junior Member
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 .. ?
-
Sep 11th, 2007, 05:07 AM
#8
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
-
Sep 11th, 2007, 05:12 AM
#9
Re: Uploading To FTP
here is some sample code, change from get to put
vb Code:
Inet1.Execute "FTP://ftp.microsoft.com", _
"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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|