Hello people,
Instead of creating resource files, what I want to do is that while my program is loading, I want my program to access a ftp server account and copy certain files on the ftp server account.
I have been told that the proper way to do this is by using the INet control. I tried searching on the forums, but it was hard to find anything useful. I haven't found anything so far and I haven't used an INet control before neither heard of it. So I someone can find me a tutorial or atleast tell me how to access a certain ftp and copy the files, I would really appreciate it.
Thank You all in advance
Khanjan
Hey... If you found this post helpful please rate it.
I would have your program write a batch file that sends the files using the ftp command built into windows. After it's written, your app could just shell it to send the files.
Figure out how to send the files from a command prompt using the FTP command, and then write those commands into a file.
First select Internet Transfer Control from Project->Components
Drag the control onto your form. Place a command button on your form. Then simply enter this code. Please enter your username & password correctly as given by the network administrator. Execute the code and check if your file has been uploaded to the server. You can then make necessary changes as you like.
Private Sub Form_Load()
Inet1.AccessType = icUseDefault
Inet1.Protocol = icFTP
End Sub
Attached is another tutorial I wrote a few years back and that used to be published at VB2theMax.com. It explains the API functions showed by oh1mie above together with a bunch of others FTP functions.
Well I would suggest to use the very good cFTP class (by Andersson ?). Look for cFTP or FileCourier in the forum. Makes adding FTP function very easy. All you need to do is :
OpenConnection
GetFile or PutFile
CloseConnection
So Easy ! No need to go through the nitty grity of Inet.
I have one problem though. How can I add a 'cancel' facility ? I want to let the user cancel a download and I think this class does not support cancel method. Any suggestion will be appreciated.
Well I would suggest to use the very good cFTP class (by Andersson ?). Look for cFTP or FileCourier in the forum. Makes adding FTP function very easy. All you need to do is :
OpenConnection
GetFile or PutFile
CloseConnection
So Easy ! No need to go through the nitty grity of Inet.
I have one problem though. How can I add a 'cancel' facility ? I want to let the user cancel a download and I think this class does not support cancel method. Any suggestion will be appreciated.
Glad you like the class . If you've found the FileCourier which I did publish as a reply to a thread here some time ago, you'll notice that it has an improved version of this class which indeed allows you to cancel the operation.
Well if you run FileCourier you'll notice that it shows a progress bar on upload/download with an estimated time it will take to finish the operation. This dialog also has a Cancel button.