Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chilkat

Pages: 1 [2] 3 4 ... 7
16
REST / HTTP / HTTPS / Re: S3 UploadBytes throwing error
« on: April 07, 2018, 12:18:02 PM »
Make sure to set both the AwsRegion and AwsEndpoint properties.
For example:

http.AwsRegion = "ap-southeast-2";
http.AwsEndpoint = "s3-ap-southeast-2.amazonaws.com";


17
You can call GetReceivedData instead.

18
C / C++ / Re: CkPrivateKey->GetPkcs8Pem problem
« on: April 07, 2018, 12:06:16 PM »
Chilkat is providing the PKCS1 PEM.  I made the fix so that PKCS8 is produced.  If you would like a new build, please let me know the exact programming language, operating system, and anything else I'd need to know (.NET Framework, Java JDK version, Perl version, etc.)

19
REST / HTTP / HTTPS / Re: Request/retrieve post data from a webhook
« on: April 06, 2018, 11:21:58 AM »
You wouldn't use Chilkat to receive the information contained in the POST sent to your ASP page.  You would just use ASP for that.
In general, however your web page  is implemented (Classic ASP, ASP.NET, PHP, Perl, Python, Ruby, etc.) you would use that language's features to collect the incoming POST information.
At that point, you might use Chilkat, if appropriate, for anything.  For example, you might use Chilkat's JSON classes to parse the received JSON.

In Classic ASP, you might begin by examining the incoming data:

<html>
<body>

<%
    for each x in Request.Form
        Response.Write("<br>" & x & " = " & Request.Form(x))
    next
%>

</body>
</html>

20
Digital Signatures / Re: Verify SMIME always succeeds
« on: April 03, 2018, 09:08:40 PM »
UwrapSecurity unwraps the encryption/signature layers and the resulting MIME is thus unencrypted and unsigned.  If UnwrapSecurity was successful, it would make no sense to call Verify afterwards because you no longer have signed MIME.  The Verify method verifies (non-recursively) the particular MIME part on which it is called.  You can call IsSigned to check to see if the MIME part is signed, and if so, then call Verify. 

21
(This problem was solved via private email.  The next version of Chilkat to be released will include the fix.)

22
Yes, you should be able to do it by calling QuickAppend.  See https://www.example-code.com/csharp/zip_appendFilesToExistingZip.asp

Read through the example carefully -- it's a little counter-intuitive..

23
Compression / Archives / Re: Archive testing.
« on: March 19, 2018, 04:34:55 PM »
The OpenZip method will perform some verification.  If it succeeds, then the zip is in good shape (certainly not entirely garbage).

If the actual compressed data for one or more entries is corrupt, then by definition, the only way to discover such corruption is by attempting to decompress.  Therefore, it's impossible to test for that sort of corruption prior to unzipping, because the test *is* to unzip.


24
Auth / Re: OAuth and what then?
« on: March 19, 2018, 04:26:27 PM »
When you use Chilkat.OAuth2 to get the token, and the browser pops up to allow the GMail account owner to authorize the access, make sure the GMail account authorizing the access is the same as the email address passed to CkoImap.Login.

25
C / C++ / Re: Chilkat multi thread
« on: March 19, 2018, 04:21:22 PM »
The forum is for discussion amongst users.  It is not the official support channel.   It is for seeking advice, helpful hints, etc. from other users.

For customers with valid non-expired support for a purchased license, send email to support@ chilkatsoft.com



27
I think you should be able to do things in this order:

  • Call ChannelSendString
  • Call ChannelSendEof
  • Call ChannelSendClose
  • Call ChannelReceiveToClose
  • Call GetReceivedText

The pollTimeoutMs argument pased to ChannelReadAndPoll is intended to be a small time duration.  It's a method where the intent it to read incoming data, and keep reading until data stops arriving.  The call will return when data stops arriving for the amount of time specified by pollTimeoutMs.  This means that any call to ChannelReadAndPoll will not return for at least pollTimeoutMs.  (It's a call good for certain situations, but not your particular situation..)

28
REST / HTTP / HTTPS / Re: Write an HTTP Server using Chilkat?
« on: February 28, 2018, 09:48:32 AM »
There is no simple solution.  Yes, one *can* write a simple HTTP server.   If one Google's "write an HTTP server", you'll get results such as "Write an HTTP server in 500 lines or less" or "Write a simple HTTP server", etc.   Whatever implementation you find by following these links is likely to be just a fragile toy.

You can write an HTTP server with limited functionality which may serve your needs.  It's important to fully understand the scope of what's potentially involved in writing an HTTP server, so you can understand what cababilities your simple implementation may lack.

If I were to begin writing an HTTP server, this is how I would begin.   (First, I would purchase the O'Reilly book "HTTP: The Definitive Guide" as a reference.  Reading the 1st few chapters is good for a fundamental understanding. The remainder is good for reference.  No need to read these books end-to-end.  Eventually, you'll have read it all many times over if you work often with HTTP..)

So here are the steps:

1) Design your architecture for receiving incoming connections and how each accepted connection is handled (perhaps in it's own thread).  We're just talking about non-SSL/TLS port 80 for now.

2) An incoming HTTP request begins with a "start line" ending with a CRLF.  Read that and parse it.  (You need a socket API that can read the socket until a particular desired string is returned.  Chilkat Socket provides a ReceiveToCRLF method.)

3) HTTP requests and responses are MIME.  The HTTP request MIME header follows the start line, so you can read until a double-CRLF is received.  (MIME headers are separated from MIME bodies with a double CRLF.)   For example, you could call Chilkat.Socket.ReadUntilMatch("\r\n\r\n");   

4) You can parse the MIME header using Chilkat.Mime (or CkMime in some programming languages).   Load the HTTP request MIME header by calling Chilkat.Mime.LoadMime.  Now you have access to information about the request.  In the simple case, you'll find a Content-Length header field that indicates the exact number of bytes that constitute the MIME body of the request, which should follow the MIME header. 

5) Read the number of bytes indicated by Content-Length.  Don't assume you have text.  Call Chilkat.Socket.ReceiveBdN to read the MIME body.   But first, append the MIME header to the Chilkat.BinData object you pass to ReceiveBdN.  The ReceiveBdN method will append incoming bytes to the BinData object.  Now you have the full HTTP MIME request in a BinData object.  Create a new Chilkat.Mime object instance and load the full MIME by calling Mime.LoadMimeBd.   This solves a huge amount of potential complexity because the Chilkat.Mime class is correctly handling encodings, charsets, etc.  You can now access the parts of the HTTP request via the Chilkat.MIME API.

6) The response you formulate is similar to the HTTP request.  It's a "start line" followed by the HTTP response, which is MIME.  You could potentially use Chilkat.Mime to compose your response, or you could emit the response as you see fit.  The important part of the response is to ensure the value in the Content-Length response header is the exact raw size of the MIME body that follows.




The above is just the start..  It's still just a toy because there are potentially a huge number of things to consider:

1) Will "chunked encoding" HTTP requests be received?  Should for large responses, should "chunked encoding" responses be sent?

2) How to handle Authentication?  (If a request uses an Authorization header.)

3) Handle the "Expect: 100-continue" header.

4) What if the request uses a gzip Content-Encoding?  Would you want to send a compressed response?

5) How to listen on port 443 w/ TLS?  (Chilkat.Socket can do it, but you'd need a certificate, possibly self-signed if the client doesn't care..)

6) What about anything to do with proxies?

Anyway.. the list goes on and on.  You can build a simple HTTP server, with the awareness of what's lacking so you're not surprised when something's not working because a particular feature is needed. Then, of course, you could add features over time until one day you'll have something that's truly not a toy anymore..  :)

29
REST / HTTP / HTTPS / Write an HTTP Server using Chilkat?
« on: February 28, 2018, 09:13:28 AM »
I need to write a small http server to get remote access to my application. I tried to find anything that I could use to write a http server in the Chilkat library. Didnít find anything, but just wanted to be sure that I havenít missed anything before finding another simple solution.

30
ActiveX / Re: VB 6 CODES FOR CONVERTING BASE64 STRING TO IMAGE
« on: February 26, 2018, 09:29:04 AM »
Here are links to an example:

(You'll find a "Visual Basic 6.0" example in the list..)


Decode Base64 Image String (GIF, JPG, etc.) and Save to File

Android: http://www.example-code.com/android/base64_image.asp
Classic ASP: http://www.example-code.com/asp/base64_image.asp
C: http://www.example-code.com/C/base64_image.asp
Chilkat2-Python: http://www.example-code.com/chilkat2-python/base64_image.asp
C++: http://www.example-code.com/cpp/base64_image.asp
C#: http://www.example-code.com/csharp/base64_image.asp
C# UWP/WinRT: http://www.example-code.com/csharp_winrt/base64_image.asp
DataFlex: http://www.example-code.com/dataflex/base64_image.asp
Delphi ActiveX: http://www.example-code.com/delphiAx/base64_image.asp
Delphi DLL: http://www.example-code.com/delphiDll/base64_image.asp
.NET Core C#: http://www.example-code.com/dotnet-core/base64_image.asp
Excel: http://www.example-code.com/excel/base64_image.asp
Visual FoxPro: http://www.example-code.com/foxpro/base64_image.asp
Java: http://www.example-code.com/java/base64_image.asp
Lianja: http://www.example-code.com/lianja/base64_image.asp
MFC: http://www.example-code.com/mfc/base64_image.asp
Mono C#: http://www.example-code.com/mono/base64_image.asp
Node.js: http://www.example-code.com/nodejs/base64_image.asp
Objective-C: http://www.example-code.com/objc/base64_image.asp
Perl: http://www.example-code.com/perl/base64_image.asp
PHP ActiveX: http://www.example-code.com/phpAx/base64_image.asp
PHP Extension: http://www.example-code.com/phpExt/base64_image.asp
PowerBuilder: http://www.example-code.com/powerbuilder/base64_image.asp
PowerShell: http://www.example-code.com/powershell/base64_image.asp
PureBasic: http://www.example-code.com/purebasic/base64_image.asp
Python: http://www.example-code.com/python/base64_image.asp
Ruby: http://www.example-code.com/ruby/base64_image.asp
SQL Server: http://www.example-code.com/sql/base64_image.asp
Swift: http://www.example-code.com/swift/base64_image.asp
Tcl: http://www.example-code.com/tcl/base64_image.asp
Unicode C: http://www.example-code.com/unicodeC/base64_image.asp
Unicode C++: http://www.example-code.com/unicodeCpp/base64_image.asp
Visual Basic 6.0: http://www.example-code.com/vb6/base64_image.asp
VB.NET: http://www.example-code.com/vbnet/base64_image.asp
VB.NET UWP/WinRT: http://www.example-code.com/vbnet_winrt/base64_image.asp
VBScript: http://www.example-code.com/vbscript/base64_image.asp
Xojo Plugin: http://www.example-code.com/xojo/base64_image.asp



Pages: 1 [2] 3 4 ... 7