Jump to content

Base64 Image post


SC0U7
 Share

Recommended Posts

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

 

Link to comment
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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...