Question:
How to you get the PDF (binary) from the request below.
https://environment.extranet.gov.ab.ca/apps/GIC/Report/ViewReport.aspx?wellreportid=12014857
You can use the Download method of the ChilkatHttp object to download and save the PDF to your computer.
This method downloads the file to the file system, I would like to download the PDF to a VARBINARY(MAX). Is this approach an option?
For binary, you can use downloaddb in ChilkatHttp to fill a BinData object. Then you can get the binary from the BinData and add it to your SQL server.
Thanks for the suggestion, might you have a code example (sql) as I am not getting anywhere productive myself.
Thanks.
I am attempting to write in tSQL.
Call http.QuickGet(the_url_for_your_PDF), which returns a Variant containing the binary bytes of the resource at the passed-in URL.
The next step is to figure out how to insert a Variant into a varbinary(max). I Googled "insert variant into varbinary max" and found many results, but this is the 1st:
http://stackoverflow.com/questions/2214628/insert-bytes-array-into-varbinarymax-record
Thanks for your help, just not getting anywhere with this method. I have written an SQLCLR to accomplish this task.
Lots of interesting options here.