searchsanjaysharma
asked on
How upload an image for a record.
I have an VB.Net windows application. I am storing the data in the fields for employees.
Now i want to store the images of the employees.
The pics will be stored in folder with file name saved as id as in employees tables,
What data type should i take for storing images.
1, can be varchar where in we can map the path
2, what could be other way.
Please send example.
Now i want to store the images of the employees.
The pics will be stored in folder with file name saved as id as in employees tables,
What data type should i take for storing images.
1, can be varchar where in we can map the path
2, what could be other way.
Please send example.
If photos aren't huge, I would suggest store them directly in the table in the Image (or binary - depends on DB type) type field. With this approach records and images will always be synchronized - when you delete employer his image will be deleted too, while with file data approach you'll have orphan images and/or records
If there is an application that is used to manage the employees, a single line of code is sufficient to delete the photo when an employee is deleted, so storing the images separately is usually not a problem.
Manipulating photos in files is a lot easier than doing so in a database.
Updating the photos with newer ones would also be easier since it could be done without having an application to do so.
Manipulating photos in files is a lot easier than doing so in a database.
Updating the photos with newer ones would also be easier since it could be done without having an application to do so.
a single line of code is sufficient to delete the photo when an employee is deletedHow many lines is sufficient if file was assidently deleted/renamed?
Manipulating photos in files is a lot easier than doing so in a database. Updating the photos with newer ones would also be easier since it could be done without having an application to do soAgree - with 100 employes. What about some thousands?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok
When you need to retrieve the image in your application, simply go to the directory that holds the images, and get the employee image from the file that has the same name as the ID field.