all groups > dotnet xml > july 2003 >
You're in the

dotnet xml

group:

tif file loses integrity when uploaded


tif file loses integrity when uploaded Al Knowles
7/29/2003 10:13:08 AM
dotnet xml:
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).

Does anyone have a tested example of uploading a two-page tif file from a
VB6 application to a web service
via XML? At this point I don't care how it is done, I just need something
that works!

Thanks in advance for any assistance you can provide.

Re: tif file loses integrity when uploaded Al Knowles
7/29/2003 1:18:05 PM
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]

Re: tif file loses integrity when uploaded Oleg Tkachenko
7/29/2003 7:25:37 PM
[quoted text, click to view]
So somebody has screwed up the file along uploading, show us your code.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
Re: tif file loses integrity when uploaded Al Knowles
7/30/2003 5:17:39 AM

Provided code, still seeking help.

Begin Begging...
I know you're very busy, but you are the only one who has at least
answered. I've been working on this problem for a week, and you're
supposed to be an expert.
...End Begging

Thanks again for any assistance you can provide.

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button