Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create binary file?
Message
 
 
To
28/12/2001 12:17:53
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00598854
Message ID:
00598872
Views:
14
>Hello,
>
> I've created a connection by means of winsock to a Web server. This server transmits a binary file(app) that arrives to me in several packages.
>
> When attempt to keep the file, is generated a file of the correct size but its content is corrupt.
>
> For it I use " FWRITE(fich, variable) ".
>
> I believe that the problem is that the file is binary.
>
> How to receive and store the binary file?
>
>Thanks

I can't really help you with why this is occurring. It should work if the characters haven't been munged in the Winsock transfer process.

We used FWrite years ago in a backup/recovery routine and had no problems with the fact that the files were binary (EXEs) in nature.

Could the data be getting corrupted in transport? Have you examined each block to determine if it is the same going in and out? If you have control of both ends, you could perform a check sum (Sys(2007)) and pass this in addition to the package. On the receiving end, you could strip off the check sum value, and perform another check sum. If they didn't match, you could attempt to retrieve the information again.

One other thing, instead of FWRITE(), you could use StrtoFile() to handle the same thing.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform