473,698 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

image question

Tom
hello friends

I want to specify a field to save icons I want to give this field a maximum
of 120kb for each icon to be stored in the db.

what datatype should I assign to this field and how do I specify the size ?

Thanks
Tom
Jul 20 '05 #1
7 1749

"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
hello friends

I want to specify a field to save icons I want to give this field a
maximum
of 120kb for each icon to be stored in the db.

what datatype should I assign to this field and how do I specify the size
?

Thanks
Tom


The image data type is the one used for large binary data, but you can't
specify a size - 2GB is the maximum allowed. Another common approach is to
leave the binary files in the filesystem, and simply store the path to the
file in a varchar column.

Simon
Jul 20 '05 #2
Tom
I considered that option.. however storing path is not the ideal option as
many users may have the same image or icon thus resulting the same image
being sent to all users when the image are suppose to be different as the
image gets overridden when they're the same file name

any other ideas ?
thanks
Tom

"Simon Hayes" <sq*@hayes.ch > wrote in message
news:41******** **@news.bluewin .ch...

"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
hello friends

I want to specify a field to save icons I want to give this field a
maximum
of 120kb for each icon to be stored in the db.

what datatype should I assign to this field and how do I specify the size ?

Thanks
Tom


The image data type is the one used for large binary data, but you can't
specify a size - 2GB is the maximum allowed. Another common approach is to
leave the binary files in the filesystem, and simply store the path to the
file in a varchar column.

Simon

Jul 20 '05 #3

"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
I considered that option.. however storing path is not the ideal option as
many users may have the same image or icon thus resulting the same image
being sent to all users when the image are suppose to be different as the
image gets overridden when they're the same file name

any other ideas ?
thanks
Tom


<snip>

Not really - those are pretty much the two options you have. Either use the
image data type and store the file in the database, or leave it in the
filesystem and store the path. It comes down to which approach is easier for
you, given your application and development environment.

Personally I'd go for the path, since then changing a user's icon just means
updating a single column, instead of loading the whole file into the
database. Also, any default or common icons only have to be stored once,
rather than maintaining a separate copy for each user.

You should also check out "Managing ntext, text, and image Data" in Books
Online, which covers the details of working with image data, and there's a
code sample for ADO, if that's what you're using.

Simon
Jul 20 '05 #4
I had a similar problem where i wanted people to store files on my web
server, because i was worried about file name clashes i was considering
storing them in the database. Instead I came up with two ideas, one was to
put each users files into a subdirectory named after their user name, and
two the one that im using, was to first upload the file to the server, add a
database entry and return the result of the @@IDENTITY to my program then
preclude the name of the file with the identity value.

thus... myresume.doc would become 243_myresume.do c

Hope those help,
Muhd
"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
I considered that option.. however storing path is not the ideal option as
many users may have the same image or icon thus resulting the same image
being sent to all users when the image are suppose to be different as the
image gets overridden when they're the same file name

any other ideas ?
thanks
Tom

"Simon Hayes" <sq*@hayes.ch > wrote in message
news:41******** **@news.bluewin .ch...

"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
> hello friends
>
> I want to specify a field to save icons I want to give this field a
> maximum
> of 120kb for each icon to be stored in the db.
>
> what datatype should I assign to this field and how do I specify the size > ?
>
> Thanks
> Tom
>
>


The image data type is the one used for large binary data, but you can't
specify a size - 2GB is the maximum allowed. Another common approach is
to
leave the binary files in the filesystem, and simply store the path to
the
file in a varchar column.

Simon


Jul 20 '05 #5
Tom
thanks thats a great idea

but I'm also curious would it be possible to store the icons into a binary
field and set the size of that binary field ?

Thanks
Tom

"Muhd" <ea*@joes.com > wrote in message
news:cRj4d.4939 91$gE.369174@pd 7tw3no...
I had a similar problem where i wanted people to store files on my web
server, because i was worried about file name clashes i was considering
storing them in the database. Instead I came up with two ideas, one was to put each users files into a subdirectory named after their user name, and
two the one that im using, was to first upload the file to the server, add a database entry and return the result of the @@IDENTITY to my program then
preclude the name of the file with the identity value.

thus... myresume.doc would become 243_myresume.do c

Hope those help,
Muhd
"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
I considered that option.. however storing path is not the ideal option as many users may have the same image or icon thus resulting the same image
being sent to all users when the image are suppose to be different as the image gets overridden when they're the same file name

any other ideas ?
thanks
Tom

"Simon Hayes" <sq*@hayes.ch > wrote in message
news:41******** **@news.bluewin .ch...

"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
> hello friends
>
> I want to specify a field to save icons I want to give this field a
> maximum
> of 120kb for each icon to be stored in the db.
>
> what datatype should I assign to this field and how do I specify the

size
> ?
>
> Thanks
> Tom
>
>

The image data type is the one used for large binary data, but you can't specify a size - 2GB is the maximum allowed. Another common approach is
to
leave the binary files in the filesystem, and simply store the path to
the
file in a varchar column.

Simon



Jul 20 '05 #6
Tom wrote:
thanks thats a great idea

but I'm also curious would it be possible to store the icons into a binary
field and set the size of that binary field ?

Thanks
Tom


NO, you can't specify the size of an image columt - it's variable up to 2 GB.
Here are all the types MS SQL has:

http://www.databasejournal.com/featu...e.phpr/2212141
WYGL,
Andrey
Jul 20 '05 #7


As has already been stated, you can't 'set' the size of field, but since your code would load an image
into the field, it could check that the size is within limits before loading it.

--
_______________ _______________ _______________ __________
http://www.ammara.com/
Image Handling Components, Samples, Solutions and Info
DBPix 2.0 - lossless jpeg rotation, EXIF, asynchronous
"Tom" <to********@opt ushome.com.au> wrote:
thanks thats a great idea

but I'm also curious would it be possible to store the icons into a binary
field and set the size of that binary field ?

Thanks
Tom

"Muhd" <ea*@joes.com > wrote in message
news:cRj4d.493 991$gE.369174@p d7tw3no...
I had a similar problem where i wanted people to store files on my web
server, because i was worried about file name clashes i was considering
storing them in the database. Instead I came up with two ideas, one was

to
put each users files into a subdirectory named after their user name, and
two the one that im using, was to first upload the file to the server, add

a
database entry and return the result of the @@IDENTITY to my program then
preclude the name of the file with the identity value.

thus... myresume.doc would become 243_myresume.do c

Hope those help,
Muhd
"Tom" <to********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
>I considered that option.. however storing path is not the ideal optionas > many users may have the same image or icon thus resulting the same image
> being sent to all users when the image are suppose to be different asthe > image gets overridden when they're the same file name
>
> any other ideas ?
> thanks
> Tom
>
> "Simon Hayes" <sq*@hayes.ch > wrote in message
> news:41******** **@news.bluewin .ch...
>>
>> "Tom" <to********@opt ushome.com.au> wrote in message
>> news:41******** *************** @news.optusnet. com.au...
>> > hello friends
>> >
>> > I want to specify a field to save icons I want to give this field a
>> > maximum
>> > of 120kb for each icon to be stored in the db.
>> >
>> > what datatype should I assign to this field and how do I specify the
> size
>> > ?
>> >
>> > Thanks
>> > Tom
>> >
>> >
>>
>> The image data type is the one used for large binary data, but youcan't >> specify a size - 2GB is the maximum allowed. Another common approach is
>> to
>> leave the binary files in the filesystem, and simply store the path to
>> the
>> file in a varchar column.
>>
>> Simon
>>
>>
>
>




Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3639
by: Ralph Freshour | last post by:
My .php app displays an image on the web page, I notice that different ..jpg images display "funny" - apparently they all have slightly different image widths and heights yet in the image tag I have to set those properties to something - is there a way in php to get an image width and height so I can set it correctly for each image? <IMG SRC="<?php echo $php_image ?>" WIDTH="268" HEIGHT="176" BORDER="0" ALT="">
0
2501
by: Vlado | last post by:
Hello, I need to copy/paste image from Java application to/from the System clipboard. On windows everything is just fine, but on Mac OS is not. The problem is that when I transfer image to the clipboard it's content type is image/x-java-image and when I try to paste it in some Mac application (for example MS Worf for Mac OS) it doesn't work. I think that this happens, because Word doens't understand the image/x-java-image content type....
10
2927
by: Fred Nelson | last post by:
Hi: I have programmed in VB.NET for about a year and I'm in the process of learing C#. I'm really stuck on this question - and I know it's a "newby" question: In VB.NET I have several routines that upload and process images. I can't get past "square one" with images in C#: This statement:
11
2020
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the the image but in design time mode all variables concerning Server or Context ar not set ! ...so I can't use MapPath function to obtain the physical parth of the picture ... So my second question is how to retrieve the physical root path of the...
68
4118
by: Nak | last post by:
Hi there, This might sound like a silly question but, technically could an image object be used for any image format? For example if I were to make plugins for my application, could they be made to return a specific image format as an image object, such as PSD (Only for viewing purposes). Thanks in advance Nick.
35
2661
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
12
9264
by: Lance | last post by:
hey all, first time vb.net 2005 user, after sticking vb6 out for a long time... anyway, using this code ====================== Dim FS As FileStream = File.OpenRead(Filename) Dim theImage As Image Try theImage = Image.FromStream(FS, False, False)
4
3464
by: LT.Ang | last post by:
I am developing an application that possibly opens very large images - bmp, jpeg, tiff. I have 2 questions: Language: C#, VS .NET 2003. 1. When the program opens a BMP image, the amount of memory used seems to be larger for BMP files than JPEGs with the same pixel dimensions. For example, 5200 x 5000 pixels image -- increase in Mem Usage is about 80MB for JPEG, but 200MB for BMP (with Task Manager). The Mem Usage is noted before and...
6
6450
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data) and be able to load them to an image webcontrol, but system.web.ui.webcontrols.image only seems to have a control to load the image from a URL. There's no way to load this directly without saving the image as a file and then using...
6
4757
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since the area element implies a link to some other item or page location, but would like to hear what others think. If it helps at all, the page which prompted me to ask the question is this one: ...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.