FTP question

elayevskiy
01-14-2002, 03:59 PM
I am trying to receive and send files using Inet1 Control.
I was able to receive a file, but it's in BIN mode. I used command Execute, "Ascii". But VB errors out when I use this command.
Any ideas?
Thank you,
Eugene.

bene
01-14-2002, 04:02 PM
I called Microsoft support about this same problem, and they told me that it was a glitch in the Inet control where the Ascii transfer mode is not supported. I ended up using the APIs that the control hides from you in order to get the job done. I will see if I can find my code and send it your way...

bene

elayevskiy
01-14-2002, 04:05 PM
thank you. This code will help.

bene
01-14-2002, 04:25 PM
Okay... I had to hack this example up a little bit, but if you look at the code you should get the idea. The module that I included you can just use... it holds everything you will need to perform the functions you asked for without changing anything around. Now if you look at the two buttons I supplied on the main form, you should see that you need to do a few things manually (like opening the internet connection, etc.) that the Inet control previously did for you, but if you follow the example I don't think you will have a problem.

Hope this helps. I know when I hit this problem I was very very frustrated... let me know if anything is unclear and we can work through it, okay?

bene :D

bene
01-14-2002, 04:30 PM
Oh, one more thing... if you look at the Form Load event you can see where I tell it to transfer in ASCII mode...

dwType = FTP_TRANSFER_TYPE_ASCII

That is what is not working on the Microsoft component. If you need to be able to transfer both in ASCII or Binary, then use FTP_TRANSFER_TYPE_BINARY for the dwType. Both of the constants (along with some other stuff) are inside that module.

Good luck...

bene

elayevskiy
01-14-2002, 04:41 PM
I click on this file to download, but it doesn't go anywhere. Bene, do you know how to download this file?

Thinker
01-14-2002, 05:00 PM
If you can't download by clicking the link, then right-click on it and
select save target as.

elayevskiy
01-14-2002, 05:18 PM
Thank you very much for your help

byrne1
01-24-2002, 08:38 AM
This code works great! Thanks! I have a problem when the code runs into an error. I get the following message:


Can't find entry point InternetGetLastResponseInfoA in wininet.dll


Can someone help me figure this one out?

Also, is there a way to show a progress bar when transferring a large file?

Thanks again for the code!

bene
01-24-2002, 10:31 AM
I would do a search and make sure that the computer you are running on has wininet.dll. I believe if the DLL was not there it would generate this error.

As far as the progress bar, I am not sure, but you would need to be able to determine the size of the file first, and once you had done that, then you could divide the size of the file by the transfer rate... anyway, something along those lines. I believe transfer rates sometimes fluctuate though, and getting a somewhat accurate percentage could be difficult. There are probably a lot of people in this forum who would be better able to answer that half of your question.

Hope this helped a little...

Bene

bene
01-24-2002, 10:57 AM
Also... I was going back over the project I sent you, and I think this one will help out more. So, take a look at this one, it may run without that error you were getting... anyway, hope this helps.

Bene :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum