Inserting/retrieveing image into/from MySql using C# and .NetConnector
Posted by: Mikael Segercrantz
Date: August 25, 2007 10:03AM

Hello Everyone,

In a website project I'm doing, I have the need to insert image files into a MySql database. The website is being done in C# and ASP.Net, using the .Net connector for MySql.

The table looks like this:

nk_kuva: the table name itself :)
ID_Kuva: ID field, primary key, unsigned integer, not null
Nimi : name of file, varchar(255), not null
Koko : size of the file, unsigned integer, not null
Kuva : the image itself, mediumblob, not null
Tyyppi : the mime type, varchar(255), not null

The user uploads an image file via an html form. I know how to find the file sent by the user and how to resolve the mime type for it, but not how to actually load the image and store it into the database.

Also, retrieving the image from the database and sending it as part of a page is looking a bit hard to me, so any assistance here would be appreciated, as well.

Options: ReplyQuote


Subject
Written By
Posted
Inserting/retrieveing image into/from MySql using C# and .NetConnector
August 25, 2007 10:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.