473,548 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Respon se.OutputStream , System.Drawing. Imaging.ImageFo rmat.Gif);

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

Its urgent ..

Thanks and regards..
Sham
Sep 17 '08 #1
2 1881
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(MemoryStr eam ms = new MemoryStream()) {
bit.Save(ms, System.Drawing. Imaging.ImageFo rmat.Gif);
buffer = ms.ToArray();
}
....
SqlCommand cmd = new SqlCommand();
....init
cmd.Parameters. Add(new SqlParameter("b lob", Buffer))
....
cmd.ExecuteNonQ uery()

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
11743
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 table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem...
3
2864
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 image control with the specific file - all information: path name, file name and file extention are included in one field of each record in the report...
1
2694
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: Me.BookCover.Picture = IIf(Me.IsCover= true, Me.BookCoverPath, "") to avoid problems when the file specified in field does not exist I add a logical...
6
5571
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" alt="testing" /> So I created an HttpHanlder to handle PNG images, have mapped the PNG extension in the IIS and also added the HttpModule section in...
0
1364
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 images/binary data in a DB, it works for me.) It is in c# and it works great, except that when the file returns to the browser after being pulled out of...
7
17045
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 = "photo/thumbs/"; // Path To Thumbnails Directory $twidth = "125"; // Maximum Width For Thumbnail Images
10
7045
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 only small sized iamages.. for eg. resizing takes place for 70 kb sized images but fails for 600kb or more.. my code is below..
2
245
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 runat="server" ID="myImage" ImageUrl = "<%=myImageFileName %>" /> The variable myImageFileName is set in either the Page_Init or Page_Load
3
4856
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 directory/filename as the search string? While Path, FileInfo, and DirectoryInfo all store the path information, they use the path case passed to them, so passing a...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7444
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7954
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...
1
5367
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...
0
5085
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...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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
1
1054
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.