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.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Visual Basic

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-13-2008, 04:58 PM
Pyrforos
 
Posts: n/a
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?


Reply With Quote
  #2 (permalink)  
Old 03-13-2008, 05:42 PM
Reverend Fuzzy
 
Posts: n/a
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?
>



Reply With Quote
  #3 (permalink)  
Old 03-13-2008, 05:42 PM
Reverend Fuzzy
 
Posts: n/a
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?
>



Reply With Quote
  #4 (permalink)  
Old 03-13-2008, 05:42 PM
Reverend Fuzzy
 
Posts: n/a
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?
>



Reply With Quote
  #5 (permalink)  
Old 03-13-2008, 05:42 PM
Reverend Fuzzy
 
Posts: n/a
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?
>



Reply With Quote
  #6 (permalink)  
Old 03-14-2008, 01:48 PM
Pyrforos
 
Posts: n/a
Re: Intenet transfer Control

Yes, I use Total commander and works perfect.


Reply With Quote
  #7 (permalink)  
Old 03-14-2008, 01:48 PM
Pyrforos
 
Posts: n/a
Re: Intenet transfer Control

Yes, I use Total commander and works perfect.


Reply With Quote
  #8 (permalink)  
Old 03-14-2008, 01:48 PM
Pyrforos
 
Posts: n/a
Re: Intenet transfer Control

Yes, I use Total commander and works perfect.


Reply With Quote
  #9 (permalink)  
Old 03-14-2008, 01:48 PM
Pyrforos
 
Posts: n/a
Re: Intenet transfer Control

Yes, I use Total commander and works perfect.


Reply With Quote
  #10 (permalink)  
Old 03-14-2008, 03:07 PM
Reverend Fuzzy
 
Posts: n/a
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.
>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Visual Basic


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:00 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mortgage Calculator | Loans | Free Advertising | Credit Card | Web Advertising



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114