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

Open a file save as byte

How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.
Nov 20 '05 #1
4 1578
' Convert the byte array to a string

Dim ascii As ASCIIEncoding = new ASCIIEncoding();

Dim strText As String = ascii.GetString(myDoc);

"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.

Nov 20 '05 #2
Do you know the type of data in your byte array or the original file name ?

if so you could just write your byte array out to a temp file and then use
Process.Start(tempfilename) so long as it has the correct extension and it
is mapped in windows.
"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.

Nov 20 '05 #3
* "Nicolas" <nl*****@hotmail.com> scripsit:
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.


You will have to save it to disk using 'System.IO.FileStream' and then
use 'System.Diagnostics.Process.Start' to open the file.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
So I should Save the Type of the file within the database right.
and then how do you go to create the file (byte array out to a temp file)
because i don't know if it is a text or graphic or media file

Thank again
"Greg Young" <gr********@planetbeach.com> wrote in message
news:uw**************@TK2MSFTNGP11.phx.gbl...
Do you know the type of data in your byte array or the original file name ?
if so you could just write your byte array out to a temp file and then use
Process.Start(tempfilename) so long as it has the correct extension and it
is mapped in windows.
"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.


Nov 20 '05 #5

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

Similar topics

4
by: Dorte | last post by:
Hi, I am using the code below to stream a CSV file with the response object. Dim FileName As String = "Test.csv" With Web.HttpContext.Current.Response ...
1
by: Andrew | last post by:
I'm adding this as it to me a while to figure out all the pieces to be able to do this without using Microsoft.Office.Interop which caused me problems on the web-server. Streaming is the easy...
3
by: Debbie Carter | last post by:
Can XML files be easily encrypted?
4
by: Satya | last post by:
I am trying to display a PDF file (which I am being passed from a web service as a binary stream) in a browser, but I am being prompted to save the file instead. I don't want the user to be...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
15
by: Sharon | last post by:
Hello gurus, I have a System.IntPtr pointing to the memory address of my image (not a ..NET image). I wish to save this image data pointed by the IntPtr to a raw data file. The way I now to...
1
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to...
1
by: cmrhema | last post by:
Hi I have saved a file name in sqlserver datatype Binary. When I open the file from asp.net it opens but it asks for an option Save as, I click that and then it opens too Once I do this I will...
0
by: TaraPriest | last post by:
Hi all, I've got a vb.net web application that is using a web service to stream documents from a repository. Once the service feeds me the document I'l downloading it using the browser response...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.