-
hi all.
I am trying to download a file from my FTP using the Inet control, and I just cant. why??
Here is the code I uses:
Code:
Inet1.Protocol = icFTP
Inet1.Username = "abcd"
Inet1.Password = "abc"
Inet1.URL = "ftp://ftp.geocities.com"
Inet1.Execute "GET /docs/1.txt c:\1.txt"
What is wrong in this code???
I just wanna download the file "ftp.geocities.com/docs/1.txt" into "c:\1.txt"
waiting for answer,
-
Place the host first i think that's the prob.
other than that it looks fine.
Code:
Inet1.Protocol = icFTP
Inet1.URL = "ftp://ftp.geocities.com"
Inet1.Username = "abcd"
Inet1.Password = "abc"
Inet1.Execute "GET /docs/1.txt c:\1.txt"
Laterz,
D!m
-
Thanks but It still doesnt work.
I still get an error: "Unable to connect to remote host"
any other ideas?
-
Well, obviously, the last part of the code isn't the one arguing. It just can't conncet.
You gotta check if the hostname is right and maybe define the port on which it should connect, works for me.
-
Will you (or some1) please give me a piece of code for uploading the file "c:\1.txt" into "ftp.geocities.com/BLAH/1.txt" ?
lets say i registered the username: Blah
and I registered the password: 1234
Play with the port or with whatever you want, just post the correct piece of code.
Thanks Again.
-
I doubt you can do that
Are you sure the geocities.co will let you upload to /BLAH?
Or does geocities map each user's login to their own private root file system.
Lior, the rule when faced with a troubleshooting excercise like this is to first establish if you can "do it the long way". What I mean is, start ftp manually - you know the funny looking DOS prompt thing.
If you already know all about it, ignore my post as it will only irritate you :)
Type open ftp.geocities.com
This will prompt you for a username. Put in the username and press enter.
Next a prompt for your password will appear. Put in your password and press enter.
Finally, you will either get in or be rejected. When I used Blah/1234 I was rejected. You may have only meant those as examples so you can try yourself.
Once you are in, type your get command. remember "GET" is relative to the host, so you are saying to the host "please send me this file". If you want to upload TO geocities, then you need to use "put".
Som more hints on the command line ftp tool; type "dir" or "ls" (they amount to the same thing usually). See what files are available. Navigate through the site using the command line tools and the familiar "cd" command.
Basically, if you can do it with the command line, then you ought to be able to do it with VB. Until you confirm you can do it with the command line, I don't think you can expect a solution from anyone.
Regards
Paul Lewis
-
I'm sorry if i'm going to repeat what Paul said but i just don't have time to read it. :)
Anyways...it almost garanteed that it's a l/p probelm..eigher you don't have access to that ftp or your suplying the wrong credentials.
Hope that helps,
D!m
-
Guys, I checked if I can upload files to \Blah at ftp.geocities.com, and it worked.
I did it using CuteFTP.
Geocities let me to upload files to my registered directory: \blah.
Any1, Please, I'm just frustrated, I need a piece of correct code. Why is it so complicated just to upload 1 ugly text file?
Waiting for my life saver,
-
What is CuteFTP
If CuteFTP is a gui based ftp tool - sort of drag and drop stuff, then I am sorry but you cannot be sure that it is doing some things you are not aware of.
If it is a command line tool like the standard "ftp.exe" that comes with Windows NT (And I presume Windows 9X as well) then I am unable to offer any further help.
I suspect that CuteFTP is a gui and so I repeat my last suggestion to try to do it manually. If you do not wish to help yourself, I doubt you will get the code you seek.
I've never done any programming with the inet control so I cannot offer direct help there. I just know that ftp is relatively simple and there is very little that a control like the one you are using can get wrong.
I can help more but only if you need it and if you try the command line ftp and manually put the file on the server (or get it if you want).
regards
Paul Lewis
-
it is working also with ftp.exe
please, some1, write for me just a few lines, the code itself.
Thanks. Still waiting.