Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Im saving images in one folder. now i want to insert images in data base table.
is possible???.

im using ingress version 10.0.

What I have tried:

Saving images in one folder in project.
Posted
Updated 21-Dec-18 2:01am

See this article To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem - Microsoft Research[^]

Personally I wouldn't store images on a database - all that is going to do is fill up your database very (very) quickly with static data. IMHO a better approach is to store the image on a server location and store that location with the name of the file on the database. I also advise avoiding explicit paths, just store the path relative to a root folder. I have experienced the pain of relocating images where explicit paths were embedded into the metadata - it was not a pleasant experience.
 
Share this answer
 
I would recommend that you keep the images in your file system, and just keep a relative path in your table.

Images are large and will bloat your database.
While one image may only be an MB or two, try doing SELECT * FROM tImages when you have a few thousand rows. It is not a pretty site.

The image will need to be reconstituted to be seen
What this means is that after you (finally) receive the bytes from the database, you will have to utilize a memory stream or some other byte array to contain this and to feed it to the end user. This will chew up some memory and CPU ticks.
If the end user is using a web browser to view this, there will be no cacheing of the data, so every time the picture is called it will be a new client-server-database-server-client trip. As opposed to a simple client-cache if it was a "physical" file.

In short, it is a performance nightmare. You will be using more resources both in the database and in the application.
You will also have a negative impact on other applications calling the database. And you might as well chalk up anyone else using the network as those BLOBs of data move around.

There are very few legitimate needs that would require this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900