Sign in to follow this  
Followers 0
Ontosy

LibCurl attempt

8 posts in this topic




#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites
Up

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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?

Share this post


Link to post
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?

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.

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
Sign in to follow this  
Followers 0