Support > General Discussions
curl::option CURL,"COOKIEFILE"
Script_test:
hello again, the option does not work under windows.
--- Code: ---curl::option CURL,"COOKIEFILE","cookies.txt"
--- End code ---
Any idea how to solve, an update?
thank you very much in advance.
Support:
Did you try using a full path for cookies.txt?
Just a guess. I would look at the LibcURL docs and do a Google search for the option, specifying Windows.
Script_test:
It doesn't matter the path. The problem is that not create the file. :-[
This small example, attempt to log into a local installation of wordpress. On my systen (windows) does not generate the file to store cookies.
--- Code: ---Import "c:\scriptbasic\include\curl.bas"
Import "c:\scriptbasic\include\cio.bas"
rem Login & Pass
username = "admin"
password = "password"
rem web Site
url = "http://localhost/wordpress/"
rem Directory
directorio ="c:\\scriptbasic\\wordpress\\"
cookie = directorio & "\\cookie.txt"
rem Form Data
postdata = "log=" & $username & "&pwd=" & $password & "&wp-submit=Log%20In&redirect_to=" & url & "wp-admin/&testcookie=1"
CURL = curl::init()
curl::Option CURL,"CONNECTTIMEOUT",6
curl::option CURL,"FRESH_CONNECT"
curl::option Curl,"BUFFER_SIZE",1024
curl::option CURL,"FOLLOWLOCATION"
curl::option CURL,"MAXREDIRS",7
curl::option CURL,"REFERER",url & "wp-login.php"
curl::option CURL,"USERAGENT","Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36"
curl::option CURL,"COOKIEFILE",cookie
curl::option CURL,"URL",url & "wp-login.php"
curl::option Curl,"POSTFIELDS",postdata
rem File
curl::option CURL,"FILE",directorio & "file.txt"
rem VERBOSE
curl::option Curl,"VERBOSE"
curl::perform CURL
curl::finish CURL
rem
--- End code ---
Support:
Windows doesn't like files being created in the root directory.
Can you try running your script in a console that has administrative privileges? This will tell you if it's a permission problem or not.
Script_test:
Yes, is running under administrator privileges.
Navigation
[0] Message Index
[#] Next page
Go to full version