SC0U7

Base64 Image post

5 posts in this topic

Hello :) i have this code:

 

Global  $fp="bla.jpg"

$sFile = $fp

$sForm = _
        '<form action="http://imgur.com/api/upload.xml" method="post" enctype="multipart/form-data">' & _
        '    <input type="file" name="image" />' & _
        '    <input name="key">' & _
        '</form>'


$hOpen = _WinHttpOpen()
$hForm = $sForm
$sRead = _WinHttpSimpleFormFill($hForm, $hOpen, Default, "name:image", $sFile, "name:key", "b3625162d3418ac51a9ee805b1840452")
_WinHttpCloseHandle($hForm)
_WinHttpCloseHandle($hOpen)
If $sRead Then ConsoleWrite($sRead & @CRLF)

 

 

But it doesnt working IMGUR reply(Image format not supported, or image is corrupt) i think it is with post but i dont know how to implement a base64 encode for it.. can someone help me ? Thanks

 

Share this post


Link to post
Share on other sites



My guess is that you use older version of the UDF in combination with newer AutoIt. AutoIt had some internal changes with default file processing algos which could result in script-breaking behavior depending on specific circumstances.

Your code should work if the file is valid image. Check the image validity, and also check what version of WinHttp.au3 you use, as well as AutoIt version.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

it Works correctly using WInHttp 1.6.3.9. and autoit v3.3.14.1

@trancexx I never get tired of seeing your photo. lol

Saludos

1 person likes this

Share this post


Link to post
Share on other sites

Thanks all :)  i go try it

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