Recent Posts

Pages: [1] 2 3 ... 10
1
Hi.

Thanks for the suggestion. I try using GetReceivedData and it works!

Best,
2
JSON / Get index from JSON array from Value
« Last post by cbourne on April 11, 2018, 09:20:22 AM »
Hi,

Im using the following powershell example. Is it possible to search for an item in an array and get an the index?

Code: [Select]
$json = New-Object Chilkat.JsonObject

$jsonStr = "{ `"id`": 1, `"name`": `"A green door`", `"tags`": [`"home`", 22, `"green`"], `"price`": 125 }"

$success = $json.Load($jsonStr)
if ($success -ne $true) {
    $($json.LastErrorText)
    exit
}

#  Get the "tags" array, which contains "home", 22, "green"
$tagsArray = $json.ArrayOf("tags")
if ($tagsArray -eq $null ) {
    $("tags member not found.")
    exit
}

#  Get the value at each array index.
#  Output will be:
#  [0] = home
#  [0] as integer = 0
#  [1] = 22
#  [1] as integer = 22
#  [2] = green
#  [2] as integer = 0

$arraySize = $tagsArray.Size

for ($i = 0; $i -le $arraySize - 1; $i++) {

    $sValue = $tagsArray.StringAt($i)

    $("[" + $i + "] = " + $sValue)

    $iValue = $tagsArray.IntAt($i)
    $("[" + $i + "] as integer = " + $iValue)

}

#  Note: The StringAt method returns the value as a string regardless of the type.

#  The IntAt method returns the value as an integer.  If the value does not convert to
#  an integer, then 0 is returned.

i.e.. get the index value of "green" from the "tags" array?

3
REST / HTTP / HTTPS / Re: Request/retrieve post data from a webhook
« Last post by plokij909 on April 10, 2018, 08:17:10 PM »
Here's the code to use if anyone else is having troubles.


If Request.TotalBytes > 0 Then
  Dim lngBytesCount
  lngBytesCount = Request.TotalBytes
  jsonstring = BytesToStr(Request.BinaryRead(lngBytesCount))
End If

    Function BytesToStr(bytes)
        Dim Stream
        Set Stream = Server.CreateObject("Adodb.Stream")
            Stream.Type = 1 'adTypeBinary
            Stream.Open
            Stream.Write bytes
            Stream.Position = 0
            Stream.Type = 2 'adTypeText
            Stream.Charset = "iso-8859-1"
            BytesToStr = Stream.ReadText
            Stream.Close
        Set Stream = Nothing
    End Function
4
C / C++ / Are CkJavaKeystore, CkPem and CkPfx thread safe ?
« Last post by DevSidious on April 10, 2018, 09:58:26 AM »
Quoting from

http://cknotes.com/tag/multi-threading/

Quote
Question:
Are the Chilkat C++ libraries safe for multi-threading?

Answer:
Yes. However, it is best practice that you donít allow multiple threads to call methods on the same object instance at the same time.

I am planning to use a CkJavaKeystore, CkPem or CkPfx as in memory storage for entities (certificates and keys). Based on the quote above, Chilkat C++ library is thread safe, however I couldn't find any mention on thread safety in the documentation pages of the aforementioned types.

1. Are CkJavaKeystore, CkPem and CkPfx implemented in a thread safe manner or do I have to explicitly lock on concurrent reads/writes?
2. If CkJavaKeystore, CkPem and CkPfx are thread safe, why would it be considered best practice not to call methods on them concurrently?
5
C / C++ / Re: CkPrivateKey->GetPkcs8Pem problem
« Last post by Chilkat on April 08, 2018, 01:32:02 PM »
Here's a 64-bit Linux pre-release:  https://chilkatdownload.com/prerelease/chilkat-9.5.0-x86_64-linux-gcc-463.tar.gz

(The number "463" is just a counter number to create a unique URL to avoid caching issues..)
6
C / C++ / Re: CkPrivateKey->GetPkcs8Pem problem
« Last post by Chilkat on April 08, 2018, 01:12:05 PM »
The fix will be in the next version.

If you tell me the version of MSVC, I can provide a pre-release build.  I'll create a Linux x86_64 build sometime today and will post the link here..
7
C / C++ / Re: CkPrivateKey->GetPkcs8Pem problem
« Last post by DevSidious on April 08, 2018, 09:51:07 AM »
I'm static linking against Chilkat C/C++ libs. Momentarily building on Windows (MSVC) and Linux X86_64 (GCC) so I could get away with Windows and Linux X86_64 builds. At some point I will have to be able to build on Mac OS X and Linux ARM.

Do you know when the fix is going to be available in the official Chilkat downloads?

Thanks.
8
REST / HTTP / HTTPS / Re: S3 UploadBytes throwing error
« Last post by plokij909 on April 08, 2018, 07:23:11 AM »
That worked! Thank you!
9
REST / HTTP / HTTPS / Re: S3 UploadBytes throwing error
« Last post by Chilkat 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";

10
You can call GetReceivedData instead.
Pages: [1] 2 3 ... 10