trancexx Posted July 4, 2016 Posted July 4, 2016 The same way how? You can or you can't? ♡♡♡ . eMyvnE
RyukShini Posted July 13, 2016 Author Posted July 13, 2016 @trancexx I still had no luck, can you tell me if you know some sort of solution?
RyukShini Posted July 13, 2016 Author Posted July 13, 2016 On 04/07/2016 at 11:59 AM, trancexx said: The same way how? You can or you can't? I am doing it the exact same way, I can log in from my browser on both, not on my script.
trancexx Posted July 13, 2016 Posted July 13, 2016 5 hours ago, RyukShini said: @trancexx I still had no luck, can you tell me if you know some sort of solution? You need to give me more info. It works on all sites I have access to. Here's an idea... give me your credentials. Hah! AutoBert and mLipok 2 ♡♡♡ . eMyvnE
RyukShini Posted July 15, 2016 Author Posted July 15, 2016 On 13/07/2016 at 5:00 PM, trancexx said: You need to give me more info. It works on all sites I have access to. Here's an idea... give me your credentials. Hah! That would be the easiest without a doubt, but unfortunately I cannot do so :/ I'll have to figure something out on my own I guess, but thank you thus far
AlienStar Posted September 9, 2020 Posted September 9, 2020 (edited) On 6/26/2016 at 3:26 PM, trancexx said: 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 the code was working very well but I don't know what happened ! I re-use the same code above with my all wordpress sites suddenly I faced the error login = 4 or 1 and can't upload an image please help I need it so much Edited September 9, 2020 by AlienStar
rudi Posted September 15, 2020 Posted September 15, 2020 @AlienStar You need to specify you goals and your issus *FAAAR* more precisely! Same as in the other thread with your INI section task ...😉 Earth is flat, pigs can fly, and Nuclear Power is SAFE!
AlienStar Posted September 16, 2020 Posted September 16, 2020 (edited) 15 hours ago, rudi said: @AlienStar You need to specify you goals and your issus *FAAAR* more precisely! Same as in the other thread with your INI section task ...😉 first, thanks so much my friend for help next, image upload code was working well and I don't know what happened after a while so I can't upload and send me upload error that's why I've searched a lot then found the solution using IE functions I reach the image upload page then select the image Local $url = $sDomain&"/wp-admin/media-new.php?browser-uploader" Local $oIE_img =_IECreate($url) _IELoadWait($oIE_img) Local $async_upload = _IEGetObjById($oIE_img, "async-upload") Local $upload_btn = _IEGetObjById($oIE_img, "html-upload") _IEAction($async_upload, "focus") Local $hIE = _IEPropertyGet($oIE_img, "hwnd") ControlSend($hIE, "", "Internet Explorer_Server1", " ") WinWait("Choose File to Upload", "", 10) Sleep(1000) WinActivate("Choose File to Upload") ControlSetText("Choose File to Upload", "", "[CLASS:Edit; INSTANCE:1]", $IMG_Loc) Sleep(1000) WinActivate("Choose File to Upload") ControlSend("Choose File to Upload", "", "", "{ENTER}") WinWaitClose("Choose File to Upload", "", 1) _IEAction($upload_btn, "click") Edited September 16, 2020 by AlienStar
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