np
It could be like this:
#include "WinHttp.au3"
$sDomain = "http://myurl.com/"
$sLoginPage = "/wp-login.php"
$sUploadPage = "/wp-admin/media-new.php"
$sLoginName = "username"
$sPassword = "mypassword"
; Choose file to upload
$sFileToUpload = FileOpenDialog("Choose something (Image better maybe?)", "", "All (*.*)")
If $sFileToUpload Then
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, $sDomain)
; Login first
_WinHttpSimpleFormFill($hConnect, _
$sLoginPage, _
"loginform", _
'user_login', $sLoginName, _
'user_pass', $sPassword)
ConsoleWrite('! Error for login = ' & @error & @LF)
_WinHttpSimpleFormFill($hConnect, _
$sUploadPage, _
"file-form", _
'async-upload', $sFileToUpload)
ConsoleWrite('! Error for upload = ' & @error & @LF)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
EndIf