penfold Posted November 29, 2019 Posted November 29, 2019 I am trying to use the following code Invoke-WebRequest -Uri 'webpage' -Method POST -InFile "c:\test.txt" But no matter what I do I get the following errors: Invoke-WebRequest : HTTP Error 405.0 - Method Not Allowed or Exception calling "UploadFile" with "3" argument(s): "The remote server returned an error: (404) Not Found." Please don't suggest any other methods as due to security set in place. Can anyone suggest what is wrong or where I can look to start troubleshooting this problem. I've granted access via BITS for upload and user has correct permission on the folder. Webpage resolves OK if I put it into browser. I'm kind of stuck now and need a second pair of eyes. OR am I doing this completely wrong? Thanks
mavhc Posted November 29, 2019 Posted November 29, 2019 AIUI you can't just send a file, has to be encoded like https://stackoverflow.com/questions/8659808/how-does-http-file-upload-work 1
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