1
我一直在試圖讓我的應用程序發送圖像數據爲基礎64到一個.net網絡服務,它將其轉換回圖像並將其保存在服務器上。ASIFormDataRequest圖像上傳通過.net壞請求
這適用於一個小的10px x 10px圖像,但對於其他任何我從服務器得到一個錯誤的請求響應。這是我的代碼。我正在做的XML,因爲我不能讓postValue工作。
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[reqstring setString:@"<Files xmlns=\"http://schemas.datacontract.org/2004/07/FileUpload\">"];
[reqstring appendString:@"<filename>"];
[reqstring appendString:@"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI"];
[reqstring appendString:@"</filename></Files>"];
[request appendPostData:[reqstring dataUsingEncoding:NSUTF8StringEncoding]];
[request setValidatesSecureCertificate:NO];
[request addRequestHeader:@"Content-Type" value:@"text/xml"];
[request setDelegate:self];
[request setDidFinishSelector:@selector(requestUploadFinished:)];
[request setDidFailSelector:@selector(requestUploadFailed:)];
[request startSynchronous];
是否有限制什麼可以以這種方式發送或需要改變的服務器上的任何東西?
這種事情的任何好的教程?
任何幫助將不勝感激