|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Byte array to streamWe have a regular ASP website that uses the third party ASPUpload control
for uploading files. Those files are in the byte array format, ready to be stored into SQL Server. I need to transfer that byte array to a .Net (2.0) DLL (through COM) and then convert it to a filestream so that I can write it to a directory on the server. I'm having trouble figuring out how to do that. Anyone have some ideas on the best way to do that? Thanks Jon Here the basic idea. I'd recommend extra checks to see if path exists,
exception handling, etc. Public Sub CreateFileFromBytes(ByVal fileAsBytes() As Byte, ByVal pathToWrite As String) Dim fs As FileStream = New FileStream(pathToWrite, FileMode.CreateNew) fs.Write(fileAsBytes, 0, fileAsBytes.Length) fs.Flush() fs.Close() End Sub Show quoteHide quote "Jon" wrote: > We have a regular ASP website that uses the third party ASPUpload control > for uploading files. Those files are in the byte array format, ready to be > stored into SQL Server. I need to transfer that byte array to a .Net (2.0) > DLL (through COM) and then convert it to a filestream so that I can write it > to a directory on the server. I'm having trouble figuring out how to do > that. > > Anyone have some ideas on the best way to do that? > > Thanks > Jon > > >
HttpWebRequest using Certificates
Pulling specific words from a string Asynchronous Invoke and the UI thread (using delegates) How to use my default mail client to mail any file? Accessing Mdi Child Form Control form another one Cannot add MSWord reference How to pass parameter? error "concurency violation" Testing simple VB code in design time? .NET and MS Word : setting rightAlignment ??? |
|||||||||||||||||||||||