NileshSutar Posted September 18, 2013 Posted September 18, 2013 Hello everyone. I am very new to autoit.So i want to know how can i transfer an image file from remote pc to my pc.I have permission to run any script on that pc.So please guide me.
water Posted September 18, 2013 Posted September 18, 2013 Welcome to AutoIt and the forum! Is his PC located in a company environment? Security considerations might limit the possible solutions. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
NileshSutar Posted September 18, 2013 Author Posted September 18, 2013 Is his PC located in a company environment? No it is not.I want t odo it from any pc
water Posted September 18, 2013 Posted September 18, 2013 You could install a FTP server on the target PC. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
NileshSutar Posted September 18, 2013 Author Posted September 18, 2013 (edited) You could install a FTP server on the target PC. how about TCP file transfer.Will it work for sending images.The image size is not more than 300kb Edited September 18, 2013 by NileshSutar
water Posted September 18, 2013 Posted September 18, 2013 What do you mean by "TCP file transfer"? Can you elaborate? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
NileshSutar Posted September 18, 2013 Author Posted September 18, 2013 (edited) What do you mean by "TCP file transfer"? Can you elaborate? i want to send files over tcp from that pc to mine. i have got the following code for senders pc: expandcollapse popup#include<GUIConstants.au3> GUICreate("Send",200,120) $File = GUICtrlCreateInput("",10,10,100,20) $fileopendialog = GUICtrlCreateButton(" ... ",120,10,40,20) $serverinput = GUICtrlCreateInput("",10,40,100,20) GUICtrlCreateLabel("Server-IP",120,40) $ok = GUICtrlCreateButton(" Send ",40,80,40,20) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf If $msg = $fileopendialog Then $Fileopen = FileOpenDialog("File open",@desktopdir,"All (*.*)") GUICtrlSetData($File,$Fileopen) EndIf If $msg = $ok Then Call("sendfile") EndIf WEnd Func sendfile() Local $szConfirm = "" Local $sock = -1 Local $data $server = GUICtrlRead($serverinput) $FileSent = GUICtrlRead($File) TCPStartup() $sock = TCPConnect($server,50911) $data = FileRead($FileSent,FileGetSize($FileSent)) SplashTextOn("Send","Sending ...",200,40) TCPSend($sock,FileGetSize($FileSent) & "," & $data) SplashOff() While 1 $szConfirm = TCPRecv($sock,128) If @error Or StringLen($szConfirm) Then TCPShutdown() ExitLoop EndIf WEnd EndFunc and receivers pc(my pc): Dim $iMainSocket = -1, $iSocket = -1 Dim $buffer = "" Dim $bytes = -1 Dim $iRet = -1 TCPStartup() $iMainSocket = TCPListen(@IPAddress1,50911) While 1 If $iSocket = -1 Then $iRet = TCPAccept($iMainSocket) If Not @error Then $iSocket = $iRet Else $buffer &= TCPRecv($iSocket,4096) If $bytes = -1 And StringInStr($buffer,",") Then $bytes = StringLeft($buffer,StringInStr($buffer,",")-1) $buffer = StringTrimLeft($buffer,StringInStr($buffer,",")) Else SplashTextOn("Receive","Receiving ...",200,40) If StringLen($buffer) = $bytes Then SplashOff() $FileReceived = FileSaveDialog("File save",@desktopdir,"All (*.*)") ExitLoop EndIf EndIf EndIf WEnd FileDelete($FileReceived) FileWrite($FileReceived,$buffer) MsgBox(4096,"","Transfer Complete") TCPShutdown() i want my pc to listen from any pc that is connecting to me at port 50911.If the script is already designed to do that then its ok,but if it is not designed to do that then can you plz suggest changes to my above script. Edited September 18, 2013 by NileshSutar
water Posted September 18, 2013 Posted September 18, 2013 Doesn't look bad. Have you already tried to transmit a file? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
NileshSutar Posted September 18, 2013 Author Posted September 18, 2013 Doesn't look bad. Have you already tried to transmit a file? No i havent tried yet.
water Posted September 18, 2013 Posted September 18, 2013 I tried and it works just fine here. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators JLogan3o13 Posted September 18, 2013 Moderators Posted September 18, 2013 No i havent tried yet. You have all of that written out, but you didn't try it before posting?! "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
NileshSutar Posted September 19, 2013 Author Posted September 19, 2013 You have all of that written out, but you didn't try it before posting?! Soory,but i havent written it.I searched for two days on forum and found this code
NileshSutar Posted September 19, 2013 Author Posted September 19, 2013 I tried and it works just fine here. thanks
NileshSutar Posted September 19, 2013 Author Posted September 19, 2013 i have got another question.Shall i ask it here or make a new thread??
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