Link to home
Start Free TrialLog in
Avatar of Member_2_6479049
Member_2_6479049

asked on

How to upload an image file from my computer to my server using Visual Basic 6?

Hi guys,

I'm developing an app in vb6 that will contain Contacts but also the pictures of the persons, so i' thinking to create a folder on the network to contains all the pics, so my mySQL database won't contains them.

I already show the picture of the person on the form and i have a text box containing the path of the file, What I need now is to save, upload or copy the picture on the network folder.

This is the code to show the pic:

Private Sub cmdFoto_Click()
    CommonDialog1.ShowOpen
    txtBuscaFoto.Text = CommonDialog1.FileName
    Image1.Picture = LoadPicture(txtBuscaFoto.Text)
End Sub


Please any help!!!

Thank you guys.
ASKER CERTIFIED SOLUTION
Avatar of Element1910
Element1910
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robberbaron (robr)
have you explored saving the image as a blob in MySQL ? would make moving your app at a later date much easier and keep all the data together.
complete with Vb.net example that could be converted to VB6....
http://dev.mysql.com/doc/refman/5.5/en/connector-net-programming-blob.html


http://forums.mysql.com/read.php?20,17671,27914


Tip: To be able to insert images that are bigger than 1MB you have to increase the max_allowed_packed option in the server configuration file. You can change that in the Startup Variables section in the MySQL Administrator on the Networking page.
Avatar of Member_2_6479049
Member_2_6479049

ASKER

Thank you so much guys,

I think the best way to save the pics in on the server, Thank you Rob.
Thnak you so much element, it works great!!!
You're welcome! :) Glad I could help!