Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return binary data to web server from VFP using C
Message
From
05/04/2003 09:04:44
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00773698
Message ID:
00774406
Views:
14
>Still at it building a home made solution, huh? <g>

Yes. I desided to use VFP with Apache 2 CGI since this is the most dominant web server.

To avoid fixing vfpcgi.exe bug on binary data, it may be possible to
call a vfp application exe instead of vfpcgi.exe
This increases the perfomance a lot since no timer polling is required.
(MS sample server.app has timer interval 250 MS. So it can process max 4 requests in a second).

Are there some samples available on reading stdin and write to stdout from
VFP ? I remember this was discussed somewhere.

I can create a very small vfp exe file for a cgi which is loaded fast.
Is may be possible to lock vfp dlls in memory so that they are not re-loaded.

Since WWC cgi module is the same as MS mycgi.c, does it have the same bug by
discarding 0xOO bytes ?
Is it possible to appli some coding (base64) to output data so that binary
data is not sent ?

About ISAPI:

How to write a MT DLL in VFP 7 which can be used instead of FOXISAPI.dll
This may eliminate the foxisapi.dll call overhead in web server.

>
>printf() doesn't handle CHR(0)'s as it sees it as a string terminator. You can use File output functions to write to StdOut as well such as WriteFile() API calls to which you can pass output, or fWrite() (you have to get the handle to StdOut for that first).
>
>You can write to StdOut from VFP using Windows API calls with CreateFile, WriteFile() and CloseHandle() ( I think ), but htis is a really bad idea as VFP is way too large to load up from scratch on every CGI hit.
>
>+++ Rick ---
>
>
>
>
>>I created a VFP 7 CGI application using vfpcgi which returs PDF files.
>>
>>I noticed that zero bytes (0x00) are not passed to web server.
>>
>>This is because mycgi.c shipped with vfp uses
>>
>>printf( "%s", buffer );
>>
>>to return data to web server . printf() stops writing if zero byte is
>>reached.
>>
>>It is possible to fix this by changing mycgi.c file and re-creating an exe
>>file.
>>
>>Unfortunately, I don't have Microsoft VC++ compiler required to
>>create vfpcgi.exe
>>
>>Can anybody create a correct vfpcgi.exe file or is there correct
>>vfpcgi module available somewhere ?
>>
>>Is it possible to read stdin and write to stdout from a VFP 7 application ?
>>This will eliminate the need of using vfpcgi.
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform