![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Intenet transfer Control
Hi everybody,
I have this tiny problem which I am not able to solve. I use an Internet Transfer Control to upload a file. I use the following code which I found on vb-helper. Private Function UploadFile(ByVal source_file As String, ByVal dest_file As String, ByVal host_name As String, ByVal user_name As String, ByVal passwd As String) As Boolean ' Get the file's contents. On Error GoTo UploadError ' You must set the URL before the user name and ' password. Otherwise the control cannot verify ' the user name and password and you get the error: ' ' Unable to connect to remote host If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & host_name inetFtp.URL = host_name inetFtp.UserName = user_name inetFtp.Password = passwd ' Do not include the host name here. That will make ' the control try to use its default user name and ' password and you'll get the error again. Debug.Print "Put " & source_file & " " & dest_file inetFtp.Execute , "Put " & source_file & " " & dest_file UploadFile = True Exit Function UploadError: MsgBox "Error " & Err.Number & _ " uploading file '" & _ source_file & "' to '" & _ dest_file & "'." & vbCrLf & Err.Description, _ vbExclamation Or vbOKOnly, _ "Download Error" UploadFile = False Exit Function End Function The problem is that when I try to execute this code from the computer in my work (directly connected to the Internet) the code is executed without any problem. When I try though to run the code from my home computer the code doesn't execute (no file is uploaded). From my home I connect to the Internet with a lan (computer connected to a switch which is conected to the ADSL Rooter). I am able to retrieve information with IntTransfContr from the Internet but I cannot upload. Any suggestions? |
|
|||
|
Re: Intenet transfer Control
Are you able to use any standard FTP programs
at home? Specifically via port 21 ? "Pyrforos" <someone@mail.gr> wrote in message news:frbiv4$20n9$1@ulysses.noc.ntua.gr... > Hi everybody, > > I have this tiny problem which I am not able to solve. > I use an Internet Transfer Control to upload a file. > I use the following code which I found on vb-helper. > > Private Function UploadFile(ByVal source_file As String, ByVal dest_file > As String, ByVal host_name As String, ByVal user_name As String, ByVal > passwd As String) As Boolean > ' Get the file's contents. > On Error GoTo UploadError > > ' You must set the URL before the user name and > ' password. Otherwise the control cannot verify > ' the user name and password and you get the error: > ' > ' Unable to connect to remote host > If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & > host_name > inetFtp.URL = host_name > inetFtp.UserName = user_name > inetFtp.Password = passwd > > ' Do not include the host name here. That will make > ' the control try to use its default user name and > ' password and you'll get the error again. > Debug.Print "Put " & source_file & " " & dest_file > inetFtp.Execute , "Put " & source_file & " " & dest_file > > UploadFile = True > Exit Function > > UploadError: > MsgBox "Error " & Err.Number & _ > " uploading file '" & _ > source_file & "' to '" & _ > dest_file & "'." & vbCrLf & Err.Description, _ > vbExclamation Or vbOKOnly, _ > "Download Error" > UploadFile = False > Exit Function > End Function > > The problem is that when I try to execute this code from the > computer in my work (directly connected to the Internet) the > code is executed without any problem. > When I try though to run the code from my home computer > the code doesn't execute (no file is uploaded). > From my home I connect to the Internet with a lan (computer > connected to a switch which is conected to the ADSL Rooter). > I am able to retrieve information with IntTransfContr from the > Internet but I cannot upload. Any suggestions? > |
|
|||
|
Re: Intenet transfer Control
Are you able to use any standard FTP programs
at home? Specifically via port 21 ? "Pyrforos" <someone@mail.gr> wrote in message news:frbiv4$20n9$1@ulysses.noc.ntua.gr... > Hi everybody, > > I have this tiny problem which I am not able to solve. > I use an Internet Transfer Control to upload a file. > I use the following code which I found on vb-helper. > > Private Function UploadFile(ByVal source_file As String, ByVal dest_file > As String, ByVal host_name As String, ByVal user_name As String, ByVal > passwd As String) As Boolean > ' Get the file's contents. > On Error GoTo UploadError > > ' You must set the URL before the user name and > ' password. Otherwise the control cannot verify > ' the user name and password and you get the error: > ' > ' Unable to connect to remote host > If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & > host_name > inetFtp.URL = host_name > inetFtp.UserName = user_name > inetFtp.Password = passwd > > ' Do not include the host name here. That will make > ' the control try to use its default user name and > ' password and you'll get the error again. > Debug.Print "Put " & source_file & " " & dest_file > inetFtp.Execute , "Put " & source_file & " " & dest_file > > UploadFile = True > Exit Function > > UploadError: > MsgBox "Error " & Err.Number & _ > " uploading file '" & _ > source_file & "' to '" & _ > dest_file & "'." & vbCrLf & Err.Description, _ > vbExclamation Or vbOKOnly, _ > "Download Error" > UploadFile = False > Exit Function > End Function > > The problem is that when I try to execute this code from the > computer in my work (directly connected to the Internet) the > code is executed without any problem. > When I try though to run the code from my home computer > the code doesn't execute (no file is uploaded). > From my home I connect to the Internet with a lan (computer > connected to a switch which is conected to the ADSL Rooter). > I am able to retrieve information with IntTransfContr from the > Internet but I cannot upload. Any suggestions? > |
|
|||
|
Re: Intenet transfer Control
Are you able to use any standard FTP programs
at home? Specifically via port 21 ? "Pyrforos" <someone@mail.gr> wrote in message news:frbiv4$20n9$1@ulysses.noc.ntua.gr... > Hi everybody, > > I have this tiny problem which I am not able to solve. > I use an Internet Transfer Control to upload a file. > I use the following code which I found on vb-helper. > > Private Function UploadFile(ByVal source_file As String, ByVal dest_file > As String, ByVal host_name As String, ByVal user_name As String, ByVal > passwd As String) As Boolean > ' Get the file's contents. > On Error GoTo UploadError > > ' You must set the URL before the user name and > ' password. Otherwise the control cannot verify > ' the user name and password and you get the error: > ' > ' Unable to connect to remote host > If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & > host_name > inetFtp.URL = host_name > inetFtp.UserName = user_name > inetFtp.Password = passwd > > ' Do not include the host name here. That will make > ' the control try to use its default user name and > ' password and you'll get the error again. > Debug.Print "Put " & source_file & " " & dest_file > inetFtp.Execute , "Put " & source_file & " " & dest_file > > UploadFile = True > Exit Function > > UploadError: > MsgBox "Error " & Err.Number & _ > " uploading file '" & _ > source_file & "' to '" & _ > dest_file & "'." & vbCrLf & Err.Description, _ > vbExclamation Or vbOKOnly, _ > "Download Error" > UploadFile = False > Exit Function > End Function > > The problem is that when I try to execute this code from the > computer in my work (directly connected to the Internet) the > code is executed without any problem. > When I try though to run the code from my home computer > the code doesn't execute (no file is uploaded). > From my home I connect to the Internet with a lan (computer > connected to a switch which is conected to the ADSL Rooter). > I am able to retrieve information with IntTransfContr from the > Internet but I cannot upload. Any suggestions? > |
|
|||
|
Re: Intenet transfer Control
Are you able to use any standard FTP programs
at home? Specifically via port 21 ? "Pyrforos" <someone@mail.gr> wrote in message news:frbiv4$20n9$1@ulysses.noc.ntua.gr... > Hi everybody, > > I have this tiny problem which I am not able to solve. > I use an Internet Transfer Control to upload a file. > I use the following code which I found on vb-helper. > > Private Function UploadFile(ByVal source_file As String, ByVal dest_file > As String, ByVal host_name As String, ByVal user_name As String, ByVal > passwd As String) As Boolean > ' Get the file's contents. > On Error GoTo UploadError > > ' You must set the URL before the user name and > ' password. Otherwise the control cannot verify > ' the user name and password and you get the error: > ' > ' Unable to connect to remote host > If LCase$(Left$(host_name, 6)) <> "ftp://" Then host_name = "ftp://" & > host_name > inetFtp.URL = host_name > inetFtp.UserName = user_name > inetFtp.Password = passwd > > ' Do not include the host name here. That will make > ' the control try to use its default user name and > ' password and you'll get the error again. > Debug.Print "Put " & source_file & " " & dest_file > inetFtp.Execute , "Put " & source_file & " " & dest_file > > UploadFile = True > Exit Function > > UploadError: > MsgBox "Error " & Err.Number & _ > " uploading file '" & _ > source_file & "' to '" & _ > dest_file & "'." & vbCrLf & Err.Description, _ > vbExclamation Or vbOKOnly, _ > "Download Error" > UploadFile = False > Exit Function > End Function > > The problem is that when I try to execute this code from the > computer in my work (directly connected to the Internet) the > code is executed without any problem. > When I try though to run the code from my home computer > the code doesn't execute (no file is uploaded). > From my home I connect to the Internet with a lan (computer > connected to a switch which is conected to the ADSL Rooter). > I am able to retrieve information with IntTransfContr from the > Internet but I cannot upload. Any suggestions? > |
|
|||
|
Re: Intenet transfer Control
Ok, and since I tried your code, and it works from both my work, and home
networks without issue, I'd say the next thing to look for would be a possible firewall issue... if you have one, try turning it off for a minute during the next test, and see if that fixes it. "Pyrforos" <someone@mail.gr> wrote in message news:frds7g$6gi$1@ulysses.noc.ntua.gr... > Yes, I use Total commander and works perfect. > |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|