got it. using iphone noobs example i had to remove several lines of code from his body string to get this to work. looking at noobs code.. make the following changes:
Code:
NSMutableData *body = [NSMutableData data];
//[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
//[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"ipodfile.jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
//[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[NSData dataWithData:imageData]];
//[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
// setting the body of the post to the reqeust
[request setHTTPBody:body];
on the server side (for those of you who might be using asp.net).. all that's needed is:
Code:
Dim sr as New StreamReader(Page.Request.InputStream)
Page.Reqeust.SaveAs("c:\my.png", False)
This was one of the last big hurdles for my app.. which i've had many such hurdles. I'm now utilizing threads, webservices to .net servers both pushing data back and forth, posting images to the server and retrieving images from the server. Save those images on the phone, working with myssql, dynamically upating webviews with content and images, tracking javascript events in those views etc. The list seems to go on and on. I do things like this frequently at my day job as a windows dev.. but I'm finally getting my head wrapped around mac development.. and it feels good!
Thanks again for everyones help.
John
__________________
----------------------------------------------------------------------
I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter:
@BostonMerlin
Feed your brain on Twitter:
@iPhoneDev101
----------------------------------------------------------------------
iPhone Apps: