[RESOLVED] File transfer through MODEM and MSCOMM
Hi all,
Using Modem and MSCOMM, I dialed a computer from another computer. I am able to send some text messages. Also i read from a text file and has send the data to the another computer, where it is collected to a text file.
My problem is, I want to send a file, like zip file from one computer and receive it in another computer with same name ,through MSCOMM and MODEM. What should be the starting point for this ?
Re: File transfer through MODEM and MSCOMM
You will need to send the filename to the other computer and then the file. Like was mentioned use binary access and read it in blocks. Send each block in order and then put them back together again on the target system.
Re: File transfer through MODEM and MSCOMM
What are the handshaking protocols which i can use in MSCOMM. Is something like Data fax protocol can be used along with MSCOMM
Re: File transfer through MODEM and MSCOMM
You can use various protocols but they are not included in MSComm. You will have to either use a different tool, find some source code or write it yourself.
I use Sax Comm, and have used PDQ Comm, both work very well and include a terminal program as well as several major protocols.
Using MSComm you can simply read a block from the file using binary access and send that block to the remote which should then write it to the target file, appending each new chunk as it arrives. The problem is that sometimes you may get an interuption or noise on the line which can cause the block to be different than the original.
1 Attachment(s)
Re: File transfer through MODEM and MSCOMM
Maybe this little thing I wrote recently will help understand file transfer via MSComm.
It is a combined sender/receiver, to be run on two connected computers.
It works with a timer. It first sends the filename and the file size, waits a short time and then sends the complete file.
The receiver saves the incoming date under this name.
It is quite simple and can give you some ideas of how to implement it.
Sending the filesize, too, gives the receiver an idea how many bytes are to be expected. So it is a very simple protocol, but it might help implementing a better one.
You can fill the list with more tna one filename and then click send.
If you uncheck the "Name" box, no name and no filesize are sent. This is only for test purposes.
Re: File transfer through MODEM and MSCOMM
Thanks for the code. I will work on it. :)
Re: File transfer through MODEM and MSCOMM
Hi. Do you still have the MSCommFIleTransfer.zip available? I cant download it :(
Re: File transfer through MODEM and MSCOMM
Quote:
Originally Posted by
greenelephant
Hi. Do you still have the MSCommFIleTransfer.zip available? I cant download it :(
Why do you need it?
Re: [RESOLVED] File transfer through MODEM and MSCOMM
I am new to MSCOMM coding in VB6 and this thread contains the same exact task I am trying to do (IE file transfer using MSCOMM) and I see WoF has kindly donated code to do this. Thats why I am asking :)
Re: [RESOLVED] File transfer through MODEM and MSCOMM
Are you also new to coding in VB6?
And why not using VB.Net or C#?
Re: [RESOLVED] File transfer through MODEM and MSCOMM
I am more familiar with VB6. Also as this thread is in the Visual basic 6 section of the forum I thought it wouldnt be a problem to ask for it (as the URL link doesnt work)
Re: [RESOLVED] File transfer through MODEM and MSCOMM
Quote:
Originally Posted by
greenelephant
I am more familiar with VB6. ...
then it's time to learn the modern technologies! ;)
Re: [RESOLVED] File transfer through MODEM and MSCOMM
I understand where you are coming from but I wish retrieve the code for this particular project. I dont have the time to relearn a new programming language for the sake of 1 project. Can you help me out or not please?
Re: [RESOLVED] File transfer through MODEM and MSCOMM
Quote:
Originally Posted by
greenelephant
... Can you help me out or not please?
No, I cannot help you with using MSCOMM.
MSCOMM worked well in time of Win16.
But then in a real world beginning of Win32 it just sucks. :(
Re: [RESOLVED] File transfer through MODEM and MSCOMM
MSComm actually works fine in Win32. VB5 and 6 are both 32 bit and create 32bit executables, OCX files are 32 bit so this is intended to work under Win32 and does not work under older versions of Windows.
As for file transfer while it can be done with MSComm it is much easier to use a tool that includes file transfer protocols like Z-Modem for example but even then serial file transfer is pretty much a thing of the past I would use it only if I had to opting for TCP transfer instead as that is much much faster and requires less code.