Jump to content
Bariqah

Autoit Use & HTTP Request

Recommended Posts

Bariqah

Hi all,

I am using AutoIt Script to upload files on DropBox ..

    $oHTTP.SetRequestHeader("Dropbox-API-Arg", '{"path":"/' $sFilename & $sExtension  &  '","mode": "add"}')

It works well.

But when the $sFilename is non-English, then it fails to upload..

I think I have to encode it somehow.. I have no clue..

 

Will appreciate your help

 

Share this post


Link to post
Share on other sites
Bariqah
6 hours ago, Bariqah said:

Hi all,

I am using AutoIt Script to upload files on DropBox ..

    $oHTTP.SetRequestHeader("Dropbox-API-Arg", '{"path":"/' $sFilename & $sExtension  &  '","mode": "add"}')

It works well.

But when the $sFilename is non-English, then it fails to upload..

I think I have to encode it somehow.. I have no clue..

 

Will appreciate your help

 

Solved it!

Func EncodeString($s)
    $result = ''
    For $i = 1 To StringLen($s)
        $char = StringMid($s, $i, 1)
        If StringIsASCII($char) Then
            $result &= $char
        Else
            $result &= '\u' & Hex(AscW($char), 4)
        EndIf
    Next
    Return $result
EndFunc

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.