Click here to Skip to main content
15,884,835 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm trying to delete a remote image using WebRequest (specifically through http)
but I'm getting the following error message :

"The remote server returned an error: (405) Method Not Allowed.".
This is the code that I'm using...

C#
WebRequest webRequest = WebRequest.Create("http://localhost/TestImage/5045.jpg");
webRequest.Method = WebRequestMethods.Ftp.DeleteFile; // "DELETE";
HttpWebResponse httpReponse = (HttpWebResponse)webRequest.GetResponse();


Please advice...
thanks.
Posted

1 solution

It's means that deletion is not allowed. :-)
What makes you thinking that you can delete it? If you don't have access to the server, just relax. If you do, you can change your server's setting if you are so brave to do so; in this case, read the product's documentation.

—SA
 
Share this answer
 
v3
Comments
Member 9790797 13-Jan-15 3:57am    
I'm working in line with this example...

http://support.microsoft.com/KB/314193

I'm just not sure if some server side settings also need to be done to enable deletion via html. Please advice.
Sergey Alexandrovich Kryukov 13-Jan-15 10:56am    
Advice on what?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900