Upload image into SQL Server table

J

Jonathan Blitz

I have a form which the user uses to enter data which is saved into an SQL
Server database.

I need them to be able to upload an image as well and to have it saved in
the same or a differant table.

How do I do this?

--
Jonathan Blitz
AnyKey Limited
Israel

Tel: (972) 8 9790365

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
J

Jon Spivey

Hi Jonathan,

You'd need an asp upload component, your host should have one available so
it's a case of asking what they've what they have available then going to
the relevant web site to read the docs. Every component works slightly
differently so I can't give a general answer.

Are you sure you want to store the images themselves in SQL Server ? There's
an article here
http://www.aspfaq.com/show.asp?id=2149
explaining the pros and cons of this approach - but there's more cons than
pros to my mind.
 
G

George Hester

My problem with getting the image to save right into the database, is I need to determine the File Format of the image first. To get the image already in the database:

http://support.microsoft.com/default.aspx?scid=kb;en-us;173308


If it is a bitmap then the file format is: PBrush I believe. This gets into OLE. It can be quite complicated. You need to make a dll:

http://office.microsoft.com/en-us/assistance/HP052802251033.aspx

In any case here is alternate way:

http://support.microsoft.com/default.aspx?scid=kb;en-us;323033
 
S

Stefan B Rusynko

Or see http://support.microsoft.com/default.aspx?scid=kb;en-us;288328




| Hi Jonathan,
|
| You'd need an asp upload component, your host should have one available so
| it's a case of asking what they've what they have available then going to
| the relevant web site to read the docs. Every component works slightly
| differently so I can't give a general answer.
|
| Are you sure you want to store the images themselves in SQL Server ? There's
| an article here
| http://www.aspfaq.com/show.asp?id=2149
| explaining the pros and cons of this approach - but there's more cons than
| pros to my mind.
|
| --
| Cheers,
| Jon
| Microsoft MVP
|
| | >I have a form which the user uses to enter data which is saved into an SQL
| > Server database.
| >
| > I need them to be able to upload an image as well and to have it saved in
| > the same or a differant table.
| >
| > How do I do this?
| >
| > --
| > Jonathan Blitz
| > AnyKey Limited
| > Israel
| >
| > Tel: (972) 8 9790365
| >
| > "When things seem bad
| > Don't worry and shout
| > Just count up the times
| > Things have worked themselves out."
| >
| >
|
|
 
K

Kevin Spencer

There is a difference between the way Access stores imsge data and the way
SWL Server stores image data. Access uses an OLE Object field, and the data
contains a header, which must be stripped when fetching the image. SQL
Server stores the raw image data alone, and storing and fetching image data
from SQL Server is therefore much simpler and easier to do.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

My problem with getting the image to save right into the database, is I need
to determine the File Format of the image first. To get the image already
in the database:

http://support.microsoft.com/default.aspx?scid=kb;en-us;173308


If it is a bitmap then the file format is: PBrush I believe. This gets into
OLE. It can be quite complicated. You need to make a dll:

http://office.microsoft.com/en-us/assistance/HP052802251033.aspx

In any case here is alternate way:

http://support.microsoft.com/default.aspx?scid=kb;en-us;323033
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top