FTP File upload, damage.

G

Guest

Hi Everyone,
I'd like to ask you what goes wrong in my program. Its a simple Ftp
uploading program, designed to upload just one file (a *.exe), as it does.
But if I copy the same file back to my desktop and run it I recieve error
codes like: C:\.....\test2.exe
The NTVDM-CPU recieved an invalid instruction.
CS:9fff IP:0054 OP:db ff ff db e7

The code uses StreamReader to read out the file.
Encoding::UTF8->GetBytes(obj->ReadToEnd()) puts it in a byte array and
uploads the whole lot, using the write function of the Stream class.
And yes, UseBinary is set to true.

Thanks in andvance,
Dexter
 
C

Carl Daniel [VC++ MVP]

Dexter said:
Hi Everyone,
I'd like to ask you what goes wrong in my program. Its a simple Ftp
uploading program, designed to upload just one file (a *.exe), as it
does. But if I copy the same file back to my desktop and run it I
recieve error codes like: C:\.....\test2.exe
The NTVDM-CPU recieved an invalid instruction.
CS:9fff IP:0054 OP:db ff ff db e7

The code uses StreamReader to read out the file.
Encoding::UTF8->GetBytes(obj->ReadToEnd()) puts it in a byte array and
uploads the whole lot, using the write function of the Stream class.
And yes, UseBinary is set to true.

Don't use a StreamReader - just read from the stream directly. Using the
UTF-8 stream reader causes the byte stream to be interpreted as UTF-8, which
it's not.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top