send files from one pc to another

digita

Active member
Joined
Jul 8, 2004
Messages
29
Programming Experience
1-3
Hi,

I dont knwo if this is in the right category, but I have a question that comes close to the discribesion.

How can I transfer files (e.g. zip files, or word documents) from one pc to another?

I don't any idea on how to start on this, so I hope someone can help me out. I am currently in the designing process, so I don't accutally have any code yet. Although I do know what i want: I will make a client, were users can add their files to a list (the filename and path is saved), then this is placed in an array. I will also make a server that will accept the transferd files, and store them in a folder. At the same time i will place a reference in a database, and it will also add a status of the file in the database. A third part is a host, that will show all files stored on the pc where the server part is installed. the host will have function to manipulate the files (change name, delete, move, etc.)

But in order to continue I need to know how i can transfer files from one pc to another.

Thanks,
Dennis
 
This is what I use to transfer an image from one pc to another:

Dim Stream As New FileStream("ImagePath", FileMode.Open)

Dim BinaryReader As New BinaryReader(Stream)

Dim ImageBuffer() As Byte = BinaryReader.ReadBytes(Stream.Length) 'This is the buffer that you may send through the socket

That on the client application. Then in server I do this:

Dim MemoryStream As New MemoryStream(ImageBuffer) 'This buffer was sent by the client

Dim Image As Image = System.Drawing.Image.FromStream(MemoryStream)


I hope you understand that it's not what you're really looking for, but it may be gives you a clue about how to do it.

Good luck!.
 
Dim Bitmap As New Bitmap('Here you pass the image object that you received)

Bitmap.Save('Here you put the path where you want to save the file)


Now, that works fine, and I have tested it a million times and never failed, but It'd be great if you could get the file name too for not saving the image file with an arbitrary name.

I hope that works for you.
Regards!:
 
Back
Top