| | 513 | == Batch file to download a file from an 825 to a PC using the 825 web server and cURL (tested with Windows 10) == |
| | 514 | |
| | 515 | {{{ |
| | 516 | rem - rcv825file.bat Batch file to download a file from an 825 to a PC using the 825 web server and Windows 10 cURL |
| | 517 | rem - usage: rcv825file.bat ipaddr filename tofile user password |
| | 518 | rem - example: rcv825file.bat 10.1.0.179 /mnt/nand/apps/ testfile6.txt C:\tstfile.txt ADMIN ***** |
| | 519 | rem - CAUTION: make sure 825 path has trailing slash |
| | 520 | set ip=%1 |
| | 521 | set dir825=%2 |
| | 522 | set filename=%3 |
| | 523 | set topath=%4 |
| | 524 | set user=%5 |
| | 525 | set password=%6 |
| | 526 | set cookiesfile=%userprofile%\Downloads\cookies825.txt |
| | 527 | |
| | 528 | rem - Login to the 825 web server |
| | 529 | curl -v -b %cookiesfile% -c %cookiesfile% "http://%ip%/cgi-bin/index?p=login&a=login" --data "user=%user%&password=%password%" |
| | 530 | timeout 5 |
| | 531 | |
| | 532 | rem - Set the directory the file will be uploaded to |
| | 533 | curl -v -b %cookiesfile% -c %cookiesfile% "http://%ip%/cgi-bin/index?p=filemgr&a=cd&d=%dir825%" |
| | 534 | timeout 5 |
| | 535 | |
| | 536 | rem - Download the file |
| | 537 | curl -v -b %cookiesfile% -c %cookiesfile% -o %topath% "http://%ip%/cgi-bin/index?p=filemgr&a=dl&n=%filename%" |
| | 538 | }}} |
| | 539 | |