0

I am trying to upload image from api to web folder using webclient. I have byte array of image and I provide folder path like http://example.com/content/images/ but in result I am getting 405 error (Method not allowed).

The solution I have tried are 1. remove WebDEV module and handler in webconfig of both api and web 2. provide credential of plesk to webclient 3. create virtual directory and change upload path to that 4. use httpclient class and use postasjsonasync

but all in vain.

Kindly suggest me with better solution

Rana Fahad
  • 11
  • 3
  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 – Sam Axe Oct 17 '19 at 21:13
  • Hello, and welcome to stack overflow. Might you please [edit] your question to share what you tried, that did not work? See [ask] which suggests, *Include just enough code to allow others to reproduce the problem. For help with this, read [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve).* As it is we don't know anything about the web method you are calling or how you are calling it. – dbc Oct 18 '19 at 00:51
  • E.g. maybe [Using the webclient to upload a file 405 error problem](https://stackoverflow.com/q/5163444) or [405 method not allowed web api](https://stackoverflow.com/q/15718741) apply but we don't know enough to say. – dbc Oct 18 '19 at 00:52

1 Answers1

0

I am actually accessing image folder of web which is returning me an error 405 (Method not allowed). Then I write a method in controller of my web and call that method using webclient and successfully upload image.

Anyways, thanks for your help

Rana Fahad
  • 11
  • 3