Okay, in a CGI application running in IIS 4.0 I am doing the following:
- Getting the standard output handle.
- SetConsoleMode(hOut, 0) to prevent "cooking" the binary data
- Sending the header "Content-type: image/jpeg\n" and "Content-length: 1841\n\n"
- Using WriteFile to send the file data
The JPEG file I am sending is 1841 bytes long. When I send exactly 1841 bytes using WriteFile I get an error that not all data has been sent. When I append an extra nul to the 1841 bytes, I get an "invalid image file" error.
Does anyone have any simple code for sending a binary file from a CGI application in IIS 4.0?
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks. Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago. Some scripts may complete nearly …
Learn the basics of lists in Python.
Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…