473,769 Members | 4,601 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 1895
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
11763
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 I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
3
2884
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 source table (data of this shape: \\server_name\folder_name\file_name.jpg). Any help appreciated....
1
2703
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 field to source table: indicating physical presence of the file. Surprisingly when there is no file ...
6
5587
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 the web.config file.
0
1382
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 the DB it will not return the file name. I had an app that did but it was useing access and was...
7
17058
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
7076
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
4870
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 lowercase path to Path.GetFullPath() will return a lowercase full path. TIA
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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...
0
9865
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...
1
7413
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
5310
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.