Search code examples
c#asp.netweb-servicesasmxweb-hosting

A Generic error occures when saving images using WebService


I have developed a WebService application in C# for Upload 5kb jpeg images to it's direcotry. When I run my WebService in Somee.com it's worked fine and I can upload files using that webservice. but Recently my partner provided me a Webhosting account from his dedicated server and I uploaded the webservice to it , the webservice works fine except webmethods that used to upload images. When I try to upload images it always give me the following error

Server was unable to process request.-->  A generic error occured in GDI+ 

WebMethod takes a BiteArray of the image as an argument and then It convert the bite array back to an Image then It create a NewInstance of that image and Dispose the previous one. and next it saves image to a Folder called "MyFileUploads" located in WebService directory.

Please tell me why i am getting this error and a way to fix it. Any help will be very apreciated.


Solution

  • I changed the permission of the directory that I save images to. And that's helped me I just granted read/write permission to the directory that I save images to.