|
-
Apr 24th, 2000, 04:03 PM
#1
Can Anyone help me out on this? From previous post, I've found out how to browse and select files using the Common Dialogue. But, comes a new problem for this poor little beginner. How do I send it out? I undestand the concept of sending messages from client and server, but, how do I send a file??
-
Apr 24th, 2000, 04:54 PM
#2
Lively Member
What do you mean??
Send it thru the TCP/IP or UDP using the Winsock Control
or copy the file to another place in the harddrive or...
-
Apr 24th, 2000, 10:06 PM
#3
sorry for not making things clear for some of you..
I basically mean sending it thru TCP/IP..
-
Apr 25th, 2000, 02:02 AM
#4
Addicted Member
hello, i had the same problen a few weeks ago, and i found how to work it out in this forums, i don't know exactly where, but i found a ready project which shows how to send a file thru TCP/IP using winsock,,,,try to find it
-
Apr 25th, 2000, 02:12 AM
#5
Addicted Member
I found the URL, try it and let me know, i can help you with this
http://www.vb-world.net/demos/winsock/
-
Apr 25th, 2000, 02:09 PM
#6
yeah.. I've found that ready made winsock thing as well. But, still I'm facing the problem of sending it to a SPECIFIC user. Unlike sending a message, I'm unable to attach the 'user's destination' together with the file I'm intending to send. hmm.. wait.. this is a bit unclear.
just imagine this code,
____________________________________________________________
Private Sub cmdSend_Click()
StrData = txtSendData.Text & txtReceiver.Text
txtSendData.Text = "bla bla bla"
txtReceiver.Text = "User 2"
frmDataEnv.tcpClient.SendData StrData
End Sub
____________________________________________________________
with that, I can send the sentence "bla bla bla" to User 2, right?? but, I can't get it to work with files. Hope u can get what I mean here.
-
May 3rd, 2000, 08:37 PM
#7
Addicted Member
ok, if you have a chatting programm with a 20 users for example, that means you will have 20 winsock controls, right??
therefore, all you have to do is to send the file to the user you want to send the file to, I hope you can get what i mean coz my english is weak, for example:
IMAGINE THAT U HAVE 20 USERS, AND YOU WANT TO SEND THE FILE TO THE USER NUMBER 12, THEN:
Private Sub cmdSend_Click()
StrData = txtSendData.Text
txtSendData.Text = "bla bla bla"
frmDataEnv.tcpClient(12).SendData StrData
End Sub
HOPE YOU CAN GET IT
-
May 3rd, 2000, 09:23 PM
#8
yeah.. thanks Mih_Flyer.. that worked pretty fine..
ehehe.. now I'm working on sending files.. and i'm now facing the problem of getting the file and saving it in a directory..
can u help me out?
-
May 4th, 2000, 02:56 AM
#9
What you need to do is, load up the file like you normaly would do, and read it all the way thru end, and yo know how you store the contents in a variable? well make sure that the variable is in the data type "byte" once you do that, and then what you do is send the file the same way you send text except send them the content of the variable.. and the other side should be able to save what u sent them to a file..
-
May 4th, 2000, 03:19 PM
#10
ahh.. i get want u mean there Wild Ghost, but, is it too much for me ask for a sample code?
especially on the 'saving the file' part.. thanks
-
May 5th, 2000, 08:23 AM
#11
Originally posted by KenC.J
ahh.. i get want u mean there Wild Ghost, but, is it too much for me ask for a sample code?
especially on the 'saving the file' part.. thanks
no it's not too much to ask, but the only problem is that I don't have a code handy, there's a file transfering program on vb-world somewhere, it's as simple as it gets.. because the winsock sends what's in it's buffer, and I think the buffer is only 12k or something, if u don't do some conversions and stuff, it won't send the whole file.. I don't know if u get what I mean....
BTW, I think someone posted a link to it already: http://www.vb-world.net/demos/winsock/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|