Values passed from vb6 application via xml:
iBinStream is the binary file with tags
<DOCUMENT><IMAGE>data</IMAGE></DOCUMENT>
A function I found on the net called ReadBinData decodes
the file into a base64 encoded string. That is what is placed
between the IMAGE tags.
The length of the original file (iFileLen) is also provided by the client
application.
-----------------------------------------------------
Dim xmlreader As System.Xml.XmlTextReader = _
New System.Xml.XmlTextReader(New
System.IO.StringReader(iBinStream))
xmlreader.MoveToContent()
xmlreader.Read()
lfilelen = CLng(iFileLen)
Dim fs_new(iFileLen) As Byte
xmlreader.ReadBase64(fs_new, 0, iFileLen)
Dim newfile As New _
System.IO.FileStream(fs_new_file_name,
System.IO.FileMode.CreateNew, _
System.IO.FileAccess.Write)
newfile.Write(fs_new, 0, iFileLen)
newfile.Close()
xResult.Stored = True
xResult.Message = fs_new_file_name + " was stored."
xResult.NewfileName = fs_new_file_name
Return xResult
[quoted text, click to view] "Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:uh6vT2eVDHA.2288@TK2MSFTNGP12.phx.gbl...
> Al Knowles wrote:
>
> > I have researched and tried every method I can find for passing a
two-page
> > tif file from a VB6 application to
> > a web service via XML. These include XMLTextReader.ReadBase64,
> > Convert.FromBase64, and using
> > the Binary Writer. When the web service stores the file, the length is
the
> > same as the uploaded length.
> > Double-clicking on the file before it is uploaded will display it in an
> > image preview application.
> > Double clicking on the newly uploaded file always returns an error that
the
> > image format is not
> > supported. (This is all local development).
> So somebody has screwed up the file along uploading, show us your code.
> --
> Oleg Tkachenko
>
http://www.tkachenko.com/blog > Multiconn Technologies, Israel
>