Upload PNG image

213 views
Skip to first unread message

Niko

unread,
Feb 26, 2012, 4:37:12 PM2/26/12
to ASIHTTPRequest
Hello, I'm trying to upload a picture to a web service and returns me
the following message:

XML response System.InvalidOperationException: Request format is
invalid: multipart / form-data; charset = utf-8; boundary =
08032866-4FB7-0xKhTmLbOuNdArY-4B7B-9DE2-B7ED1721ED2D.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters
()
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest ()

My code is:


ASIFormDataRequest * request = [ASIFormDataRequest requestWithURL:
urlFoto];
[request setPostValue: id_informe forKey: @
"ID_INFORME"];
[request setPostValue: objFotos.codigo
forKey: @ "CODE"];

[request setData: objFotos.foto withFileName:
@ "image.png" andContentType: @ "image / png" forKey: @ "PHOTO"];

[request setDelegate: self];
[request startSynchronous];

Where is a NSData objFotos.foto.

Since the WebService VB.Net working properly.

Any ideas?

Thanks!
Reply all
Reply to author
Forward
0 new messages