Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where to save ? suggestions

Status
Not open for further replies.

TipGiver

Programmer
Sep 1, 2005
1,863
Hi,
I am thinking of re-developing a site, but now with ASP.NET. I want to have a page for admins only, where images and text can be uploaded and saved. The question is : Where should i save those data ? In a database; all or some of them ?

Thank you.
 
Saving images to a DB can be tricky. Also, it takes up a lot of disk space. What you can do is to save the path of the images in a table, along with any text you want. Then you can display a list of images, for example, in a grid, as hyperlinks and a description. Then when the user clicks the hyperlink, you display the image assocaited with the hyperlink.
 
It can be done by embedded resources as well.

Sharing the best from my side...

--Prashant--
 
Saving the images to disk will be better performing because of the lack of serialization/deserialization plus the elimination of a network trip if the database server is on a different physical tier. It's also easier to manually edit or replace images.

I'd differ slightly from jbenson, however, in that I prefer not to store the whole path of the image in a database, just the image name, where an image path resolver component prepends the file with a physical path. In my opinion, it eases maintenance because you're more isolated from the actual physical file store plus it eliminates potentially redundant path data from the field.

Note that storing serialized images in a database is not without its advantage, however. You have easy control over security and you gain an easy if inefficient way to scale out without worrying about replicating files or getting a SAN.
 
Yeah, I'd definately go with saving the images on a file server. Saving them in a database can create an unnessesary overhead when retrieving the file. However, if they are images that are for "admin" people only, make sure you secure the folder that they are stored in so that people can't guess where they are and browse directly to them.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hello,
thank you for responsing to me.

As for the "if they are images that are for "admin" people only"
-> I mean that only admins can browse the admin.aspx page and only they are able to add or delete data. Data can be an image and a txt file as the description of the picture.

The image+text will be (i think) in a repeater control.

Chrissie1, can you explain a little what you mean ? Is it possible to get the path from the page's source code ?


Thank you again !
 
I think it's what boulderbum is trying to explain.

thread855-1283076

it would at least hide the path to the image.


Christiaan Baes
Belgium

"My new site" - Me
 
Also, if would rename the images with a GUID so that you don't accidentally overwrite any previous files with the same name. You can keep a cross-reference table of the original name and the GUID for retrieval.
 
jhurst,

I would remane the images, so there should not be any duplicates and overwrites. How do i generate the guid? Like this : GUID = System.GUID.NewGuid().ToString()
 
yes, it's guarenteed to be unique, also don't forget to append the extension on the end of the GUID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top