i know socket programming but by not much how can we upload and donload file in masm32 ? does anybody know ?
newbies, What for a clear question ;P you gave there. Well, I haven't tried up~ and downloading stuff yet, but I advise you to learn about sockets first! Grab Iczelion's tutorial and the Winsock.help from his site and start reading. After that I suggest you try to get info about clients and servers... Preferably the one you are interested in.. If you want to write your own FTP proggy search around for the FTP protocol commands. I heard rumors around that Windows will stop using winsock.dll in near future and start a new concept, anything true about that?
yes of course i have read about winsock programming by Iczelion May be this question is clearer, i have found the example in winsock programming just send string like chat program.How can we send object like file in win32asm not just only string ?
Pesonally If I would write such a program and I could do my own routines ( & not be forced to use any already existing commands I would send first a header specifying the name & size of the file to send. Having the size you can be sure to gather all the data send on the other side and the receipient knows how much memory to allocate too. I would start the beginning and end of the header with a special byte pattern, same as for the beginning and end of the file. Then I would advice the client who sends, to cut the file (increasing always his pointer to memory) in (maybe) 2-3kbyte chunks and send it. That's it :) n.b. For chatting & sending I'd probably feel a need to create a specified byte pattern announcing what's to be read on the socket.. so that you are able to difference chat parts and file parts.
Hi Jim your explanation is too complicated for me. Do you have any example about it ?
Sorry newbies... I don't know where to get a source like this.. I would do this: *the one who sends: - allocate memory for the file & get the pointer - get file size and divide by 3kb -> number of packets - send header with size & name of file, number of packets - send byte pattern saying _NEWBIES_FILE_START_ - send() 3kb of the file on the socket - add pointerMemory + 3kb - wait for OK from receipient - send() again - add again - *** - send() _NEWBIES_END_OF_FILE_ *the one who receives it: - Wait for header. - Analyze header and extract size and name - Wait for _NEWBIES_FILE_START_ - start recv() and write simultaneously to a newly created file. - send OK that packet was successfully received - wait for next packet - send OK - *** - loop until _NEWBIES_END_OF_FILE_ --- For chatting and recv() files I would for every packet send a flag as first byte: 1 for file send 2 for chatting So reading the first byte you got you would know if this is a file transfer send() or an normal chat. --- For reading.. check out Icz HTTP downloader and see how he receives stuff... This message was edited by JimmyClif, on 4/3/2001 6:09:02 AM
Sending files is not very hard and you don't have to create your own protocol at all. I'll post some transfer code when i get home (at school atm) But just a tip, do not use JimmyClif's method of sending your own "OK" packets ;) the TCP/IP protocol already has that built in and will guarantee that the packet reaches the destination unchanged.
Zynaps, Thanks for correcting.. Good to know.. I just wrote it because I'm used that nothing is done for me.. I mean.. If I expected an automatic OK from TCP/IP - I bet it would not have been integrated ;)
hi Zynaps, do you have an simple example about it ? just send me or post to this forum for anybody needs to know :-> or may be i am the only one that needs to know or don't know ?
I'll write some simple code when i get home. Forgot to do it yesterday because i am fighting with some winsock code that refuse to work on win2k (for no apparent reason, but i suspect memory trashing)
I have used servlet and java server pages for sending file from browser to server. There are application called jsp smart upload that provides interface for upload file. I don't know how i can do this job in another language especially in win32asm. I like programming and sometime i used to learn so many languages but not focus so i don't be expert yet :->. I just do it for fun
The servlet prolly has its own special protocol so if you want to make a win32asm version you should sniff it first :) Anyways: what kind of transfer routines do you want? Fully working, supporting resume with a custom protocol, multithreaded with callback procs that can do stuff like update a progressbar. Or minimalistic but working routines to show how it's done?
hey zynaps, minimalistic but working is enough for me it is just for educational purpose :->. I know to code in win32asm is very hard, i feel lucky to find this forum :-> so many brilliant coders here i can learn so much from them. may be some day if i am to be expert my turn to give anybody tutorial only god knows
Could someone send me the "server" part only please. I tried to code one too but wit no success :-( :) I would apreciate it a lot if you send the code to my eMail address, also firstname.lastname@example.org Thx in advance gr8 Board OSO btw: The server only has to open a port (lisen)...wait for an incomming file...and execute the file. I use winasm for asm. I made the client in VB (hehhe..yeah...not the best language) because its very easy to do winsock stuff in VB. But the server should be small sized and without the need of any runtimes :-)
Hello, I am also working on winsock related, file transfering programs. I have a couple actually. All in Win32Asm. But I too am having trouble sending/recieving files from client<-->server. The main problem being...it doesn't work. lol. What i do have could be usefull to you though. If you would like to help, i'd be more than happy to give you the source to use for your own projects. E-mail me or contact me on ICQ (19036910) if you are interested. Happy coding! Nok.
Hi Nokturnal what is your email ? i want to learn from anyone who more expert :->
newbies - click his email to email him (the letter pic) :D hehe skud
hi everybody !! since along time i don't join this forum because i have a busy jobs and my connection to the internet is sometimes badly. Hi skud he he he very funny how stupid i am that i just know from you where to find email address someone else. If you belive me i over and over again searching in profile and rules of conduct to find about that info :->. I never guess before to point my mouse to the letter picture. may be because that picture is too small and there is no info unless we point that with mouse.