Search Tools Links Login

Transfer Picture from Client to Server


Visual Basic 6, or VB Classic

This sample code in VB6 demonstrates sending picture or image file from a client to server software via Winsock using TCP.

Original Author: Brandon Teoh

Inputs: The challenges are: (1). Maximum packet size using socket is 8191 bytes, thus if the picture/image is more than, the image will be transferred via socket in multiple packets. (2). In VB6, I have discovered that array variable can only be passed as by reference (byRef) parameter. Since there is no way to pass an array byVal and there is no way to perform thread-concurrency on the process of winsock.GetData(), the best practice is to use 'variant' to fetch binary data which comes in multiple packets instead of using byte array.

Assumes: 1. Microsoft Common Dialog Control 6.0 (SP6) 2. Microsoft Windows Common Controls 5.0 (SP6) 3. Microsoft Winsock Control

About this post

Posted: 2020-09-02
By: vb6boy
Viewed: 451 times

Categories

Visual Basic 6

Attachments

Socket-Sample-4.zip
Posted: 9/2/2020 5:58:52 PM
Size: 415,458 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.