SC0U7 Posted February 10, 2016 Share Posted February 10, 2016 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 More sharing options...
AutoBert Posted February 10, 2016 Share Posted February 10, 2016 Search for: File to Base64 String Code Generator from @UEZ. I am sure he has also posted at autoitscript.com Link to comment Share on other sites More sharing options...
trancexx Posted February 10, 2016 Share Posted February 10, 2016 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 More sharing options...
Danyfirex Posted February 10, 2016 Share Posted February 10, 2016 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 trancexx 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
SC0U7 Posted February 11, 2016 Author Share Posted February 11, 2016 Thanks all i go try it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now