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.
Last edited by vivek_master146; Jul 10th, 2007 at 11:36 PM.
Dont rely only on your luck. Work hard until You get success.
i just looked at your frm code, you need to enlose your filename in quotes as it has spaces in the path
vb Code:
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
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
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
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.
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.
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
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.
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
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
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
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.
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
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
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.
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.
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