Hi Guys,
(Disclaimer: I can ONLY use Excel VBA to perform this task due to security restrictions in work)
Story So Far
:
I am trying to automate things in work and part of that requires me to log onto an FTP server and upload files. I can automate the log in via Excel VBA and navigate to the correct page and simulate pressing the upload button but then i cannot control the "Choose File To Upload" window that pops up to enter the file location and submit the form / upload the file.
A colleague has advised me that a much better method would be to look into HTTP Post Requests as they are quicker and less prone to going wrong. Sounds like the thing i need, but, i have spent hours trying to understand them and the info i have come across via Google is pretty sparse when it comes to doing this via Excel VBA...
Where i am now:
I have used a HTTP Header Inspector to look at what is being sent at each stage and have that data below to hopefully tap into someones superior knowledge!
I need the VBA to be able to:
o log in to the website using a username and password
o navigate to a specified folder and upload a file
(o and also maybe log out afterwards ready for the next time i need to upload a file)
The header details for the log in page look like this:
https://ftp.somesiteihavetologinto.com/FTPClient/Account/Login.htm
Header
Content-Type: application/x-www-form-urlencoded
Raw Data
username: blah123
password: abc123
usewtc: true
The header details for the upload page look like this:
https://ftp.somesiteihavetologinto.com/TestDataFeeds/
Header
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryxa7mgUU8Mu6riKG1
Raw Data
Content-Disposition: form-data; name="ftpupload"; filename="C:\Users\MyName\Desktop\OutlookTestFolder\Test_Doc_20130307.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
I have seen a couple of examples in the forums that address POST via Excel but couldn't piece it together.
I am at my wits end now and any help would be appreciated!
(Disclaimer: I can ONLY use Excel VBA to perform this task due to security restrictions in work)
Story So Far

I am trying to automate things in work and part of that requires me to log onto an FTP server and upload files. I can automate the log in via Excel VBA and navigate to the correct page and simulate pressing the upload button but then i cannot control the "Choose File To Upload" window that pops up to enter the file location and submit the form / upload the file.
A colleague has advised me that a much better method would be to look into HTTP Post Requests as they are quicker and less prone to going wrong. Sounds like the thing i need, but, i have spent hours trying to understand them and the info i have come across via Google is pretty sparse when it comes to doing this via Excel VBA...
Where i am now:
I have used a HTTP Header Inspector to look at what is being sent at each stage and have that data below to hopefully tap into someones superior knowledge!
I need the VBA to be able to:
o log in to the website using a username and password
o navigate to a specified folder and upload a file
(o and also maybe log out afterwards ready for the next time i need to upload a file)
The header details for the log in page look like this:
https://ftp.somesiteihavetologinto.com/FTPClient/Account/Login.htm
Header
Content-Type: application/x-www-form-urlencoded
Raw Data
username: blah123
password: abc123
usewtc: true
The header details for the upload page look like this:
https://ftp.somesiteihavetologinto.com/TestDataFeeds/
Header
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryxa7mgUU8Mu6riKG1
Raw Data
Content-Disposition: form-data; name="ftpupload"; filename="C:\Users\MyName\Desktop\OutlookTestFolder\Test_Doc_20130307.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
I have seen a couple of examples in the forums that address POST via Excel but couldn't piece it together.
I am at my wits end now and any help would be appreciated!