[SOLVED] Using WINHTTPREQUEST
Author: knut.dybendahl@gmail.com (Knut)
Happy New Year to all! - and the title should have been edited too - but I cannot get to it! Due to some return value size limitations in our current Uniface version (9.6.04) we've had to look at using the "WINHTTPREQUEST" object available in Windows7. The call(s) to the "WINHTTPREQUEST" object works fine - the challenge occurs when the return data is anything else but text.... We need to return a pdf file from a request, and automatically store the pdf file on disk without prompting the user (via filebox). When we take the output and store it (either as text, raw or image) - the file cannot be opened in a PdfReader as the file is corrupted. Amongst others, the number of bytes stored on disk is different from what's in the header below; Content-Length: 1703 Content-Type: application/pdf Server: Microsoft-HTTPAPI/2.0 X-AspNet-Version: 2.0.50727 FileExtension: pdf Content-Disposition: attachment; filename="abc.pdf" When the 'get_responsebody' operation / method is imported to Uniface, the return value is declared as a basic type of string, and the interface is the Microsoft VT_VARIANT. When the 'get_responsestream' operation / method is imported to Uniface, the return value is declared as a basic type of string, and the interface is the Microsoft VT_VARIANT. Does anyone have any experience(s) with this that you'd be willing and able to share? Regards, Knut