ot;.format(url_base)
>>>>> url_upload = "{}tftpFileUpload.do".format(url_base)
>>>>>
>>>>> # Allows us to keep track of our login session
>>>>> print "\nLogging in to {}...".format(tftp_host),
>>>>> connect
Jun 1, 2018 at 3:38 PM Brian Meade
mailto:bmead...@vt.edu>> wrote:
So just re-read through everything and sure enough I was sending to the wrong
IP when running the script. No wonder it's shown as uploading successfully the
entire time.
Thanks for you and Stephen's assistance!
"appNav": "cmplatform",
>>>> "j_username": tftp_user,
>>>> "j_password": tftp_pass
>>>> }
>>>>
>>>> # Our login submission to the server
>>>> resp = connection.post(url_login, verify =
ot;
print "Done!"
On Fri, Jun 1, 2018 at 3:38 PM Brian Meade
mailto:bmead...@vt.edu>> wrote:
So just re-read through everything and sure enough I was sending to the wrong
IP when running the script. No wonder it's shown as uploading successfully the
entire time.
Thanks for
> # We need to grab the token the server gives us, so we can pass it back
>>> upon upload
>>> print "Grabbing a new token...",
>>> soup = BeautifulSoup(connection.get(url_upload, verify = False).content)
>>>
>>> # It's a hidden input
nput element on the upload form with the name of "token"
>> token = soup.find("input", {"name": "token"}).get("value")
>> print "Found! [{}]\n".format(token)
>>
>> # Our upload form submission data
>> payload = {
;file": (tftp_file, open(tftp_file, "rb"), {"Content-Type": "text/plain"}),
> "directory": (None, tftp_path)
> }
>
> # Our upload submission to the server
> print "Uploading file: {}...".format(tftp_file),
> resp = connection.post(url