Jump to content

LibCurl attempt


Ontosy
 Share

Recommended Posts

If your trying to use TCP or UDP there are built-in functions in the latest production version. Also for FTP check out these FTP UDFs.

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

can someone show example of using libcurl.dll for form posting?

non-lib looks like this:

Local $UploadResult = Run('curl.exe -F upload=yes -F F=@"' & $PictureToSend & '" -F CP=yes ' & $MaxPictureSize & '-F Submit="Upload" http://www.sitename.com/action.aspx', @ScriptDir, @SW_HIDE,2+4)

show me code with DLL-call :) please...

Edited by Sergy
Link to comment
Share on other sites

i try this (libcurl.dll from link above):

$PictureToSend = "folder.jpg"
$MaxPictureSize = 300

$dll = DllOpen ("libcurl.dll")
DllCall ($dll, "int", "curl_easy_init")
DllCall ($dll, "int", "curl_easy_setopt", "CURLOPT_URL", "http://www.site.com/action.aspx")
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "upload", "CURLFORM_COPYCONTENTS", "yes")
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "CP", "CURLFORM_COPYCONTENTS", $MaxPictureSize)
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "F", "CURLFORM_FILECONTENT", $PictureToSend)
DllCall ($dll, "int", "curl_easy_setopt", "CURLOPT_HTTPPOST", "post")

$result = DllCall ($dll, "str", "curl_easy_perform")

when execute curl_easy_perform AutoIt crashed.

any idea?

Link to comment
Share on other sites

  • 8 months later...

i try this (libcurl.dll from link above):

$PictureToSend = "folder.jpg"
$MaxPictureSize = 300

$dll = DllOpen ("libcurl.dll")
DllCall ($dll, "int", "curl_easy_init")
DllCall ($dll, "int", "curl_easy_setopt", "CURLOPT_URL", "http://www.site.com/action.aspx")
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "upload", "CURLFORM_COPYCONTENTS", "yes")
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "CP", "CURLFORM_COPYCONTENTS", $MaxPictureSize)
DllCall ($dll, "int", "curl_formadd", "CURLFORM_COPYNAME", "F", "CURLFORM_FILECONTENT", $PictureToSend)
DllCall ($dll, "int", "curl_easy_setopt", "CURLOPT_HTTPPOST", "post")

$result = DllCall ($dll, "str", "curl_easy_perform")

when execute curl_easy_perform AutoIt crashed.

any idea?

Perhaps you'd have more success with the command line version? I've used it in a script before and it worked great.
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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...