473,383 Members | 1,785 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,383 software developers and data experts.

How to open a image which is stored in server

Hi
I am saved my Document in server By the follwing code

coding............


If fupLoadDoc.HasFile Then
Dim reader As BinaryReader = New BinaryReader(fupLoadDoc.PostedFile.InputStream)
Dim byt() As Byte = reader.ReadBytes(fupLoadDoc.PostedFile.ContentLeng th)
''objVLEAttacheDoc.Documentimg = byt
dtDoc.Rows(intrr).Item(3) = byt
objVLEAttacheDoc.Documentimg = dtDoc.Rows(intrr).Item(3)
Else
dtDoc.Rows(intrr).Item(3) = System.DBNull.Value
objVLEAttacheDoc.Documentimg = dtDoc.Rows(intrr).Item(3)
End If

This save the Document on the server successfully
now problem is that i want to open that document
so how can i ................
plz help me.............................
Rohit Jain
Sep 5 '07 #1
3 1409
its Urgent plz help me
Rohit
Sep 5 '07 #2
Shashi Sadasivan
1,435 Expert 1GB
I havent done this, but u need to convert the bytestream (the blob) back to an image type...
have you searched for anything similar?

got something which might be of interest to you
Expand|Select|Wrap|Line Numbers
  1. OracleBlob blob = reader.GetOracleBlob(0);
  2.  
  3. Bitmap image = new Bitmap(blob);
  4. pictureBox1.Image=image;
cheers
Sep 5 '07 #3
I havent done this, but u need to convert the bytestream (the blob) back to an image type...
have you searched for anything similar?

got something which might be of interest to you
Expand|Select|Wrap|Line Numbers
  1. OracleBlob blob = reader.GetOracleBlob(0);
  2.  
  3. Bitmap image = new Bitmap(blob);
  4. pictureBox1.Image=image;
cheers
Thanks for your valuable response
i am useing sql and convert it like that but not getting how to get the path
Session("txtscan") = ObjData1.Tables(0).Rows(IntCounter1).Item(0)
Dim byt() As Byte = CType(ObjData1.Tables(0).Rows(IntCounter1).Item(0) , Byte())
Dim bmpimg As Bitmap
Dim mstream As New MemoryStream
mstream.Write(byt, 0, byt.Length)
I am not using any picture box instead of this i am using like an website we open the attachment i have done like that that working but when i am open a file from server it's not working ...............


Dim TargetFile As FileInfo
TargetFile = New System.IO.FileInfo(ViewState("Path"))
Response.Clear()

Response.AddHeader("Content-Disposition", "attachment; filename=" + TargetFile.Name)

Response.AddHeader("Content-Length", TargetFile.Length.ToString())

Response.WriteFile(TargetFile.FullName)

Response.End()
Rohit
Sep 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Erik Schulp | last post by:
Hi all, I am using a background image via a stylsheet. I've used this code: background-image:url("/images/tile.gif"); (which I think is correct) The image doesn't show up however, the path,...
2
by: Robson Carvalho Machado | last post by:
Dear Friends, Does anybody knows how to use the below code with an image stored at SQL Image field? Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
5
by: aarondouglas28 | last post by:
Hey all, I'm hoping someone can help me with a little problem I have. First a little background. I'm working on developing a site which displays live feeds from a security camera. The camera is...
35
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
1
by: amit saini | last post by:
Hi I have using back end sql server 2000, fornt end Visual Basic and For reporting using Ms-Word 2000. I have face a problem . In sql server i have using Image type data type and stored a image in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.