J
JamesB
I am saving image files from my website using the downloaddata on the web
client. This gives me a byte array, which I am then saving to a file with
the following code:
' Create the new, empty data file.
If File.Exists(ImgDest) Then
Console.WriteLine("{0} already exists!", ImgDest)
Return
End If
Dim fs As New FileStream(ImgDest, FileMode.CreateNew)
' Create the writer for data.
Dim w As New BinaryWriter(fs)
' Write data to Test.data.
w.Write(ImgArray)
w.Close()
fs.Close()
This works, in that I end up with the file(s) on my machine, but if I try
and open them they come up as invalid. Any clues? Am I missing a step to do
with image headers or something?
James.
client. This gives me a byte array, which I am then saving to a file with
the following code:
' Create the new, empty data file.
If File.Exists(ImgDest) Then
Console.WriteLine("{0} already exists!", ImgDest)
Return
End If
Dim fs As New FileStream(ImgDest, FileMode.CreateNew)
' Create the writer for data.
Dim w As New BinaryWriter(fs)
' Write data to Test.data.
w.Write(ImgArray)
w.Close()
fs.Close()
This works, in that I end up with the file(s) on my machine, but if I try
and open them they come up as invalid. Any clues? Am I missing a step to do
with image headers or something?
James.