all groups > dotnet general > november 2006 >
You're in the

dotnet general

group:

Adding images to the database


Adding images to the database Earl
11/30/2006 7:09:25 PM
dotnet general:
Looking for an idea here. I've got a .Net app connecting to SQL2005 where I
allow users to add pictures to the database. But I don't want them adding
gigantic images, so I'm looking for an idea on how to control how big of an
image they might add. I'm not interested in simply saving a pointer to a
file here.

Re: Adding images to the database Mike C#
11/30/2006 7:43:52 PM
varbinary (max) would automatically limit them to 2 GB size, but your best
bet might be to check the size on the client side if you want to limit them
to say 10 MB or something. If you send it to the server first, someone
might have just spent all that time uploading a 100 MB file only to have it
error on them. That's a waste of time and bandwidth. If you want to ensure
that, for instance, your developers can't work their way around the system
and bypass the client app to insert larger files you might look into
triggers as well.

[quoted text, click to view]

Re: Adding images to the database Cor Ligthert [MVP]
12/1/2006 12:00:00 AM
Earl,

the most easiest way is in my idea to use the thumbnail.

In this sample is that used.
Dim fo As New OpenFileDialog
If fo.ShowDialog = DialogResult.OK Then
PictureBox1.Image = PictureBox1.Image.FromFile(fo.FileName)
Dim Thumbnail As System.drawing.Image = _
PictureBox1.Image.GetThumbnailImage(32, 32, Nothing, New IntPtr)
PictureBox2.Image = Thumbnail
End If


I hope this helps,

Cor


"Earl" <brikshoe@newsgroups.nospam> schreef in bericht
news:%23eO12zNFHHA.3608@TK2MSFTNGP03.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button