473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Retrieve Image Full path with its extention

Hai,

I am developing application which handles to create thumbnail form a video
file.
I am successfully created image and i displayed it into browser by,

bit.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);

Now my situation is, i need to save it into my database(sqlserver).
Can anyone tell me how to get that displayed(currently displayed) image file
- full path with its extention(like .gif).

Its urgent ..

Thanks and regards..
Sham
Sep 17 '08 #1
2 1871
Well, if you have created it in-memory, there might not *be* any file,
except perhaps in the client's cache which you don't have access to.
You might try use Save to write to a MemoryStream, and then from a
MemoryStream you can get the raw byte[] (ToArray etc), which should be
fine for passing as a parameter to a TSQL method, for use in a
varbinary(max) [or "image" pre-SQL2005] column.

(assuming the image isn't too big; for very large byte[] you might
need to "chunk" the work)

Marc
Sep 17 '08 #2
example:

byte[] buffer;
using(MemoryStream ms = new MemoryStream()) {
bit.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
buffer = ms.ToArray();
}
....
SqlCommand cmd = new SqlCommand();
....init
cmd.Parameters.Add(new SqlParameter("blob", Buffer))
....
cmd.ExecuteNonQuery()

where your TSQL uses @blob
Sep 17 '08 #3

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
3
by: Veetold | last post by:
I have a problem with displaying image files (jpg) on my report. I got a solution from Larry Linson (Microsoft Access MVP) for which I'm grateful, but I still don't exactly know how to link an...
1
by: Veetold | last post by:
The solution you suggested works very good - thanks again. I encountered a new problem related to this topic. According to your advise I put the following line to print and format event: ...
6
by: David Bowey | last post by:
Hi There! I'm writing a custom HttpHandler to create watermarks on my PNG images of my website. So typically, a PNG image is linked in an ASPX page as follows... <img src="images/test.png"...
0
by: tmeers | last post by:
Ok so a little backgroud, I have a image upload/retrieve app http://gettinlucky.dyndns.org/Shared/ that I use and have modifyed to fit my needs. (Now while I know most people shy away from storing...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
2
by: JimCinLA | last post by:
Pardon. This question seems incredibly dumb but I seem to be suffering a brain block. I want an ASP.Net 2.0 image control to contain a variable for the image file name as shown... <asp:Image...
3
by: =?Utf-8?B?RGV2b24=?= | last post by:
Is it possible to retrieve a proper/invariant file or directory name using a lowercase full path string without having to resort to a call to GetDirectories()/GetFiles() using the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.