Send files
BlitzPlus Forums/BlitzPlus Programming/Send files
| ||
Does anybody know how to send files in an Blitz+ Program? |
| ||
Wanna be a bit more specific? Send them to where? From where? |
| ||
From PC to Pc. Peer-to-Peer. Like in ICQ |
| ||
Deep breath... You need to establish a TCP connection between a client and a server app. On the server app, the file should be loaded into a bank, and then using the WriteBytes command, write the bank's content to the network stream to be received by the client with ReadBytes into a bank, which you can then save as a file. |
| ||
Thank you. But this will be my first program using Bank/TCP. Do you have an example? That would be really nice ;-) |
| ||
From one PC to another? On a LAN:file% = WriteFile("\\Machine\SharedFolder\file.jpg") |
| ||
I haven't really used BlitzPlus for a long time as I now use MaxGUI, but I found this code in the archives and have adapted it for sending files. I haven't tested it but it should work: Server: Client (run after you've started the server): Sorry if it doesn't work (I don't have BlitzPlus installed) but it should give you a *very* primitive idea of how to transfer a file. To be used, in practice, you need to send network messages etc. Seb |
| ||
If its a binary file, like a BMP, readstring$ and writestring$ can send a pic PDQ. |