473,396 Members | 1,783 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.

Save Byte array to file

How do I save an array of bytes to a file?

I am binding a update parameter to a fileupload control. It passes the file
to my object as a Filebytes datatype. I am assuming it is just an array of
bytes and I can assign it to a byte() array. Just not sure how to save it as
a file.
May 10 '06 #1
2 4834
Hi,

you can write bytes directly into a file with System.IO.FileStream class
http://msdn2.microsoft.com/en-us/lib...ilestream.aspx

It has a Write method which accepts a byte
array(http://msdn2.microsoft.com/en-us/lib...te(VS.80).aspx)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Chris" <no****@btinternet.com> wrote in message
news:uQ**************@TK2MSFTNGP05.phx.gbl...
How do I save an array of bytes to a file?

I am binding a update parameter to a fileupload control. It passes the
file to my object as a Filebytes datatype. I am assuming it is just an
array of bytes and I can assign it to a byte() array. Just not sure how to
save it as a file.

May 10 '06 #2
I am getting the byte array from the Filebytes datatype in one of my
objectdatasource's update parameters. Is there any way I can get the
original file name like you can when you use the postedfile with the
fileupload control. Other than that it works great.

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi,

you can write bytes directly into a file with System.IO.FileStream class
http://msdn2.microsoft.com/en-us/lib...ilestream.aspx

It has a Write method which accepts a byte
array(http://msdn2.microsoft.com/en-us/lib...te(VS.80).aspx)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Chris" <no****@btinternet.com> wrote in message
news:uQ**************@TK2MSFTNGP05.phx.gbl...
How do I save an array of bytes to a file?

I am binding a update parameter to a fileupload control. It passes the
file to my object as a Filebytes datatype. I am assuming it is just an
array of bytes and I can assign it to a byte() array. Just not sure how
to save it as a file.


May 10 '06 #3

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

Similar topics

0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
6
by: Luis Arvayo | last post by:
Hello, I am trying to convert a jpeg image stored in a PictureBox to a byte array in order to later save it to a database, but I get this error : "Generic Error in GDI+". The source code is...
0
by: jcvoon | last post by:
Hi: I use the following code to copy the contents of the XMLDocument to byte array Dim xmlDoc as New XMLDocument Dim stream As New MemoryStream Dim buffers() As Byte ...
5
by: Gerrit | last post by:
Hi all, I'm getting an OutOfMemoryException when I initialize a byte array in C# like this: Byte test = new Byte; I'm using ASP.NET 2.0. In ASP.Net 1.1 it works fine. So what am I doing
0
by: lovecarole | last post by:
hi, i am the student who should write a program about reading wav file and do the DFT. actually i don't know how to read data of the wav song and save it into the array... if i want to read...
1
by: | last post by:
Hi all, I am writing a sendmail milter application in Java. The incoming mails will usually have image file as attachments. My application is currently able to extract the ImageFile and save it...
3
by: yang from china | last post by:
I cannot open TGA file use framework's class,so I am trying to convert TGA file to BMP file(or others).Now I have read the palette data and pixel data successfully.One way I create a temporary BMP...
8
by: anandmms | last post by:
Hello friend, my problem is to save more than one fingerprint images in one byte array and then store in database(oracle). i dont know how to solve it. But previously i had did image saving...
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: 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...
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
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...
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.