Results 1 to 35 of 35

Thread: [RESOLVED] Uploading file tp FTP

  1. #1

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Resolved [RESOLVED] Uploading file tp FTP

    Westconn have given me a code to upload file to ftp. He also checked it from his pc.I also provided him my username and password. The file is uploading from his pc but there is an error at line "if not ret=1 rthen stop. I am uploading the project. Please check it.
    Attached Files Attached Files
    Last edited by vivek_master146; Jul 10th, 2007 at 11:36 PM.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  2. #2

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Help!
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    i just looked at your frm code, you need to enlose your filename in quotes as it has spaces in the path
    vb Code:
    1. localfname = """C:\Documents and Settings\Vivek\Desktop\vivek.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

  4. #4

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Now also its giving same error.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    on testing the file name does not need to be quoted

    i pasted the code from your uploaded project (no edits) into excel 97 modules, on a win98 machine, it conneceted to the ftp server, i only then had to change the local filename to a valid file on this computer for it to upload, so far i have tried the code on 3 computers from different locations
    i suggest you try your code on another computer, a different internet connection or both. if you can't run in vb6 you could do as i and run in word or excel, else compile a program, with a msgbox to return values of session server and ret, don't forget the text file to upload

    another option is to try replacing the dll that is used to connect to the ftpserver, but as the other apis use the same dll i don't see why there should b a problem
    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

  6. #6

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    What dll is required to connect to the ftpserver?
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  7. #7

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    In excel the same error is coming.As u mentioned in PM.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    Public Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal pub_lngInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
    this is the dll used by most of the internet apis
    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

  9. #9
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Smile Re: Uploading file tp FTP

    Check this link
    http://support.microsoft.com/default...;EN-US;q175179

    download the VBFTP.exe .This has the WinINet API module.

  10. #10

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    I am having wininet.dll in my system directory.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  11. #11
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Re: Uploading file tp FTP

    Have you tried the VBFTP project ? Try adding the module "WININET.Bas" to your project.

  12. #12

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    One more thing. I just downloaded a ftp program from pscode which i used around 1 or two yrs back when i had win98. it worked fine at that time. But now its not working. Now i am 100% that there is a prob. of dll files. i think my wininet.dll is corrupted. I downloaded a new wininet.dll.but how to replace with the current wininet.dll which is present in my system dir. I am trying to overwrite or delete it. But there is error that it is used by other programs. I closed all program then also there is a same error.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  13. #13

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Thanks amrita. I tried vbftp but its giving same error 12029!
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  14. #14

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    The problem is not about codes. There are thousand of codes for uploading file to ftp. I think the prob. is related to dll files. My firewall is also disabled.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  15. #15
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Re: Uploading file tp FTP

    Enable firewall clent. and see.

  16. #16

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    I downloaded a software smartftp. Thats also giving error. The only software working is Download accelerater.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  17. #17
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    unregister the dll first, then register again when updated
    or start in safe mode
    or dos mode
    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

  18. #18

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    The result is same amrita after enabling firewall.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  19. #19
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Smile Re: Uploading file tp FTP

    Are you using Passive mode for FTP communication ? If so change it to active and see.

    One more thing are u using IE7 ?

  20. #20

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    I am using ie6
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  21. #21

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    I have used both in some programs.Results were same.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  22. #22

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Hi westconn when i am trying to unrigister dll then error is coming "wininet.dll was loaded but the dllunregisterserver entry point was not found. This file cannot be registered."
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  23. #23

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    I am using the command "regsvr32 /u wininet.dll"
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  24. #24
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    do a google for a progam called unlocker that is what i use to allow me to delete files that don't want to go, once you "unlock" it you should be able to copy over it
    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

  25. #25

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    The unlocker software is also not working!!
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  26. #26
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    did you try safe mode or dos mode?
    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

  27. #27

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Safe mode.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  28. #28

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Also used scf/scannow command. It does not show any error.
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  29. #29
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    i really am right out of ideas about it not working for you, have tried the code on 3 machines, with xp or win98, and at different location (different countries), everytime it just works
    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

  30. #30

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Is wininet.dll corrupted? How to scan dll files? Can u recommend any software for scanning dll files?But i have used scannow command in dos. One more thing when i am typing nslokkup command then the message is displaying "***Can't find server name address myip: non-existed domain
    ***default server are not available
    default server unknown
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  31. #31
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Uploading file tp FTP

    Is wininet.dll corrupted? How to scan dll files? Can u recommend any software for scanning dll files?But i have used scannow command in dos. One more thing when i am typing nslokkup command then the message is displaying "***Can't find server name address myip: non-existed domain
    ***default server are not available
    default server unknown
    i think that is normal for nslookup
    type ftp.avi-bags.com at the nslookup prompt, should return like
    > ftp.avi-bags.com
    Server: UnKnown
    Address: 10.0.0.2

    Non-authoritative answer:
    Name: avi-bags.com
    Address: 209.120.245.163
    Aliases: ftp.avi-bags.com

    >
    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

  32. #32

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Yes but the address u mentioned is differnet which i m getting. But can dll files be corrupted? I dont think that wininet is corrupted becasuse other applications r using it. How to scan dll files?
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  33. #33

    Thread Starter
    Fanatic Member vivek_master146's Avatar
    Join Date
    Apr 2006
    Location
    Delhi,India
    Posts
    787

    Re: Uploading file tp FTP

    Hurrrrrahhhhhhhhhhhhhhhhhhhhhh! It worked. Thanks u very much. U coperated a lot. I dont know how it worked. And other codes are also working. Thanks!!!!!!!
    Dont rely only on your luck. Work hard until You get success.
    vb Code:
    1. Private sub Time_ispassing
    2. While Me.Notgetsuccess
    3. trygain=tryagain+1
    4. Me.workhard
    5. wend
    6. end sub

  34. #34
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] Uploading file tp FTP

    i am pleased you got it working at last
    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

  35. #35
    Lively Member jkmcgrath's Avatar
    Join Date
    Dec 2004
    Posts
    79

    Re: [RESOLVED] Uploading file tp FTP

    westconn1 I like your code thank you!

    I have been trying to verify the file after upload but I have not gotten it to work.

    Would you have a snippet that might point me in the right direction?

    Thanks,
    John
    Just an infant in VB years

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