473,325 Members | 2,342 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,325 software developers and data experts.

VB6, VB.Net and binary files

Another (more experienced) developer has now been assigned to what
should have been a fairly simple task -- to upload an image file from a
VB6 application to a VB.Net WebService and to download an image file
from that web service to the VB6 application.

Generally, the approach is to turn the image file into a string and pass it
as a parameter, the to reassemble it on the other end using
Convert.FromBase64 string.

He has spent days attempting this without success.

Until today. He was able to upload a jpg file IF, once received, he
replaced all the empty strings with "+". Somehow, during the http post, the
"+" signs get lost.

He was unable to upload a tif file and have it maintain its integrity. He
suspects its because in addition to losing "+" signs, the http post adds "="
to the end of the string for no apparent reason.

Does this provide enough information that SOMEONE out there might have SOME
idea what's going wrong? This procedure must be happening in many places,
but somehow there's something the two of us just aren't getting.

As always, any and all suggestions will be greatly appreciated.

(Our boss is starting to ask what's taking us so long!)
Nov 11 '05 #1
2 6918
Al Knowles wrote:
Another (more experienced) developer has now been assigned to what
should have been a fairly simple task -- to upload an image file from a
VB6 application to a VB.Net WebService and to download an image file
from that web service to the VB6 application.

Generally, the approach is to turn the image file into a string and pass it
as a parameter, the to reassemble it on the other end using
Convert.FromBase64 string.

He has spent days attempting this without success.

Until today. He was able to upload a jpg file IF, once received, he
replaced all the empty strings with "+". Somehow, during the http post, the
"+" signs get lost.


Sounds like you are using application/x-www-form-urlencoded encoding on your
uploading form (it's default actually).
You should use multipart/form-data encoding when uploading files:
<FORM method="post" enctype="multipart/form-data" ...>

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Al Knowles wrote:
I think you are on to something there, but I can't seem to get the
syntax right:

' xXMLHTTP.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"

xXMLHTTP.setRequestHeader "Content-Type",
"enctype=multipart/form-data"

doesn't work, and I have tried several alternatives.


I have no idea what proper synatax is. I thought you are posting via HTML page
- then all you have to do is to put
<FORM method="post" enctype="multipart/form-data" ...>
tag, the rest is browser's job.
Otherwise read XMLHTTP documentation how to upload files.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3

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

Similar topics

11
by: rbt | last post by:
Is there an easy way to exclude binary files (I'm working on Windows XP) from the file list returned by os.walk()? Also, when reading files and you're unsure as to whether or not they are ascii...
27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
28
by: wwj | last post by:
void main() { char* p="Hello"; printf("%s",p); *p='w'; printf("%s",p); }
6
by: alice | last post by:
hi all, Can anybody please tell the advantages which the binary files offers over the character files. Thanks, Alice walls
4
by: knapak | last post by:
Hello I'm a self instructed amateur attempting to read a huge file from disk... so bear with me please... I just learned that reading a file in binary is faster than text. So I wrote the...
8
by: dagecko | last post by:
Hi I would like to know how to detect if a file is binary or not. It's important for me but I don't know where to start. Ty
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
15
by: JoeC | last post by:
I am writing a program that I am trying to learn and save binary files. This is the page I found as a source: http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html I have...
3
by: masood.iqbal | last post by:
Hi, Kindly excuse my novice question. In all the literature on ifstream that I have seen, nowhere have I read what happens if you try to read a binary file using the ">>" operator. I ran into...
9
by: deepakvsoni | last post by:
are binary files portable?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.