Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Pictures with ASP.Net


Message #1 by "Hugh McLaughlin" <hugh@k...> on Wed, 11 Sep 2002 17:56:12
Hello Everyone and thanks for your help in advance.  I a creating an 
online photo album that allows users to upload photos and have two 
questions:

1.  Is there any way that ASP.Net can set the comments property of a photo 
in order to provide the ability to have a caption or narration?  If so, 
how is this done?

2.  What are the pros and cons as to storing them in a folder versus a 
database.  Will the database performance be very poor or relatively 
unaffected?

Any help would be greatly appreciated.  Thanks.
Message #2 by "gordon" <gfw@y...> on Wed, 11 Sep 2002 11:57:49 -0500
Question #1, I hope someone else answers because I would also like to know.
 
Question #2, check out http://images.yyyz.net <http://images.yyyz.net>  (home site = http://dn.yyyz.net
<http://dn.yyyz.net> ). The site originally used images on disk. The current version stores images in a SQL database and I
don't really think that there is much of a performance hit.  The real benefit of using a database is maintaince - it is easy to
delete (or add) pictures and the user doesn't need write access to upload a file.
 
Just my thoughts.
 

Gfw
mailto:Gfw@y... <mailto:Gfw@y...> 
http://yyyZ.Net <http://yyyz.net/>  

 

	-----Original Message----- 
	From: Hugh McLaughlin [mailto:hugh@k...] 
	Sent: Wed 9/11/2002 12:56 PM 
	To: ASP+ 
	Cc: 
	Subject: [aspx] Pictures with ASP.Net
	
	

	Hello Everyone and thanks for your help in advance.  I a creating an
	online photo album that allows users to upload photos and have two
	questions:
	
	1.  Is there any way that ASP.Net can set the comments property of a photo
	in order to provide the ability to have a caption or narration?  If so,
	how is this done?
	
	2.  What are the pros and cons as to storing them in a folder versus a
	database.  Will the database performance be very poor or relatively
	unaffected?
	
	Any help would be greatly appreciated.  Thanks.
	---
	
	ASP.NET 1.0 Namespace Reference with C#
	http://www.wrox.com/acon11.asp?ISBN=1861007442
	
	ASP.NET 1.0 Namespace Reference with VB.NET
	http://www.wrox.com/acon11.asp?ISBN=1861007450
	
	These books are a complete reference to the ASP.NET namespaces
	for developers who are already familiar with using ASP.NET.
	There is no trivial introductory material or useless .NET
	hype and the presentation of the namespaces, in an easy-to use
	alphabetical order ensures a user-friendly reference format.
	We provide in-depth coverage of all the major ASP.NET classes,
	giving you those real-world tips that the documentation doesn't
	offer, and demonstrating complex techniques with simple
	examples. 
	
	---
	


Message #3 by "Khurram Aziz" <khurram@n...> on Wed, 11 Sep 2002 23:39:11 +0500
In my opinion Database is poor choice to store image data, but a very good
choice to store reference information that can be used to translate to some
image storred on a file system.




Regards

----- Original Message -----
From: "gordon" <gfw@y...>
To: "ASP+" <aspx@p...>
Sent: Wednesday, September 11, 2002 9:57 PM
Subject: [aspx] RE: Pictures with ASP.Net


> Question #2, check out http://images.yyyz.net <http://images.yyyz.net>
(home site = http://dn.yyyz.net <http://dn.yyyz.net> ). The site originally
used images on disk. The current version stores images in a SQL database and
I don't really think that there is much of a performance hit.  The real
benefit of using a database is maintaince - it is easy to delete (or add)
pictures and the user doesn't need write access to upload a file.
>


Message #4 by "Greg Quinn" <greg@i...> on Thu, 12 Sep 2002 12:20:33 -0700
For Question 1 - when you mean comments for the photo, do you mean the text
for the ALT tag of the image? If you want the user to view a caption or
narration for an image when mousing over it, just simply create a 'Caption'
field in the db table and write the caption when inserting the image to the
database. Then when you are displaying the photos on your web page, set the
ALT attribute of the image to the db's 'Caption' Field.

For Question 2 - I'd go for storing the images in a hard drive folder and
then referring to them from the database. From my experience it has no cons
and is easier for maintenance.

Greg Quinn
.NET Internet Application Developer
Member of AspElite

Independent IT
www.i-online.co.za
(w) + 27 12 653 6992
(f) + 27 12 653 3785
(c) + 27 83 455 0400

-----Original Message-----
From: Hugh McLaughlin [mailto:hugh@k...]
Sent: Wednesday, September 11, 2002 5:56 PM
To: ASP+
Subject: [aspx] Pictures with ASP.Net


Hello Everyone and thanks for your help in advance.  I a creating an
online photo album that allows users to upload photos and have two
questions:

1.  Is there any way that ASP.Net can set the comments property of a photo
in order to provide the ability to have a caption or narration?  If so,
how is this done?

2.  What are the pros and cons as to storing them in a folder versus a
database.  Will the database performance be very poor or relatively
unaffected?

Any help would be greatly appreciated.  Thanks.
---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.

---

Message #5 by "Mingkun Goh" <mangokun@h...> on Thu, 12 Sep 2002 12:11:28
I could not disagree with gordon's comments, but I would like to say that 
(one of) the real benefit of using of a database is SCALABILITY.

I am not a expert, so I will leave it to others to explain what is 
SCALABILITY.

Therefore I have to disagree with Khurram Aziz who says that 'Database is 
poor choice to store image data', as it is actually not difficult to store 
and access image in a SQL database using asp.net (as I have tried that 
before).

As for what Greg Quinn said, 'storing the images in a hard drive folder and
then referring to them from the database ... has no cons
and is easier for maintenance'. This is a easy approach for beginners (I 
also used this approach before), but if your application will be used by a 
lot of users, I suggest you try the SQL database approach.


Previous message:
> Hello Everyone and thanks for your help in advance.  I a creating an 
o> nline photo album that allows users to upload photos and have two 
q> uestions:

> 1.  Is there any way that ASP.Net can set the comments property of a 
photo 
i> n order to provide the ability to have a caption or narration?  If so, 
h> ow is this done?

> 2.  What are the pros and cons as to storing them in a folder versus a 
d> atabase.  Will the database performance be very poor or relatively 
u> naffected?

> Any help would be greatly appreciated.  Thanks.
Message #6 by Jagdeep Dua <Jagdeep.Dua@n...> on Thu, 12 Sep 2002 12:55:03 +0100
Just to add my two cents worth..

In my experience, adding an image, and retrieving it to/from a database is
slow. Using a pointer in the db to a physical file is not only faster,
easier to manage but also allows for the use of a separate dedicated image
server to store the images, thereby leaving the db server free to hold only
what it must. It also means that any changes to the database used does not
have to worry about how images might be stored/retrieved in the new db. 

In terms of scalability, using an image server may prove a bottleneck if all
db servers in a farm scenario had to access a single image server, but then
the images can also be replicated across boxes and access can be load
balanced across them. Since all the box is doing is serving up images, it
can be a relatively cheap one of nothing much more than a desktop spec. So a
set of image server boxes should be a cheap option too. 

Hope this helps.

Jagdeep Dua | .Net Architect | ND Technologies
4th floor, Horatio House 
Fulham Palace Road
Hammersmith W6 8JZ
t: +44 (0)20 8222 9400 f: +44 (0)20 8222 9419
w: www.netdecisions.com 
e: jagdeep.dua@n...


-----Original Message-----
From: Mingkun Goh [mailto:mangokun@h...] 
Sent: 12 September 2002 13:11
To: ASP+
Subject: [aspx] Re: Pictures with ASP.Net


I could not disagree with gordon's comments, but I would like to say that 
(one of) the real benefit of using of a database is SCALABILITY.

I am not a expert, so I will leave it to others to explain what is 
SCALABILITY.

Therefore I have to disagree with Khurram Aziz who says that 'Database is 
poor choice to store image data', as it is actually not difficult to store 
and access image in a SQL database using asp.net (as I have tried that 
before).

As for what Greg Quinn said, 'storing the images in a hard drive folder and
then referring to them from the database ... has no cons and is easier for
maintenance'. This is a easy approach for beginners (I 
also used this approach before), but if your application will be used by a 
lot of users, I suggest you try the SQL database approach.


Previous message:
> Hello Everyone and thanks for your help in advance.  I a creating an
o> nline photo album that allows users to upload photos and have two
q> uestions:

> 1.  Is there any way that ASP.Net can set the comments property of a 
photo 
i> n order to provide the ability to have a caption or narration?  If so, 
h> ow is this done?

> 2.  What are the pros and cons as to storing them in a folder versus a 
d> atabase.  Will the database performance be very poor or relatively 
u> naffected?

> Any help would be greatly appreciated.  Thanks.
---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces 
for developers who are already familiar with using ASP.NET. 
There is no trivial introductory material or useless .NET 
hype and the presentation of the namespaces, in an easy-to use 
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes, 
giving you those real-world tips that the documentation doesn't 
offer, and demonstrating complex techniques with simple 
examples.  

---

  Return to Index