Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-30-2008, 12:10 AM   #16 (permalink)
BostonMerlin
Lost in a sea of code
 
BostonMerlin's Avatar
 
Join Date: Apr 2008
Location: Boston
Posts: 399
Default

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:
BostonMerlin is offline   Reply With Quote
 

» Advertisements
» Online Users: 775
24 members and 751 guests
acegames, ADY, apatsufas, aslyworo, dabvid, ghz.rai, Graham, ilmman, IphoneSdk, iph_s, keeshux, kusreekumar, marcelglaeser, MarkC, marto1914, Ndpiparava, nfung, Pandafox, rodrigoK, RoryHarvey, technovelty, triclopus, VikMyr, zbynda
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,870
Threads: 89,225
Posts: 380,694
Top Poster: BrianSlick (7,129)
Welcome to our newest member, triclopus
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.