<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ASIHTTPRequest &#8211; Uploading Photos</title>
	<atom:link href="http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/</link>
	<description></description>
	<lastBuildDate>Thu, 15 Jul 2010 12:39:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: doug</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-8269</link>
		<dc:creator>doug</dc:creator>
		<pubDate>Thu, 15 Jul 2010 12:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-8269</guid>
		<description>I&#039;ve never tried that before. What you&#039;d need to do, is write an HTTP Server in cocoa.  Here is a simple example:
&lt;a href=&quot;http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html&quot; rel=&quot;nofollow&quot;&gt;http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never tried that before. What you&#8217;d need to do, is write an HTTP Server in cocoa.  Here is a simple example:<br />
<a href="http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html" rel="nofollow">http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Forrest</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-8255</link>
		<dc:creator>Forrest</dc:creator>
		<pubDate>Thu, 15 Jul 2010 02:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-8255</guid>
		<description>Thanks ! I found that ASIHttpRequest provides some helps for S3. I will check them out. 

Another question about back end server. If I just want to write some server using cocoa to do similar thing like &quot;php&quot; did, to receive file from your uploading, is that easy to do ? Sorry I have really no experience on back end service etc.</description>
		<content:encoded><![CDATA[<p>Thanks ! I found that ASIHttpRequest provides some helps for S3. I will check them out. </p>
<p>Another question about back end server. If I just want to write some server using cocoa to do similar thing like &#8220;php&#8221; did, to receive file from your uploading, is that easy to do ? Sorry I have really no experience on back end service etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doug</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-8245</link>
		<dc:creator>doug</dc:creator>
		<pubDate>Wed, 14 Jul 2010 15:14:31 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-8245</guid>
		<description>I&#039;m sorry, but I have no experience with Amazon S3. </description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry, but I have no experience with Amazon S3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Forrest</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-8239</link>
		<dc:creator>Forrest</dc:creator>
		<pubDate>Wed, 14 Jul 2010 08:52:30 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-8239</guid>
		<description>How about uploading images to S3 ? 

And if I just want to create another Http Server in iPhone or Mac, are there any samples we can refer to first ?

Thanks</description>
		<content:encoded><![CDATA[<p>How about uploading images to S3 ? </p>
<p>And if I just want to create another Http Server in iPhone or Mac, are there any samples we can refer to first ?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doug</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-7956</link>
		<dc:creator>doug</dc:creator>
		<pubDate>Wed, 30 Jun 2010 12:42:37 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-7956</guid>
		<description>Hi Frankie,
There is lots of sample code out there for using the imagePicker.  Basically you use some code, like I list below to save the image to the iPhone documents directory.  Then you can point at this image later to upload it somewhere...

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
	NSLog(@&quot;image width: %f image height: %f&quot;, [image size].width, [image size].height);
	NSData * imageData = UIImagePNGRepresentation(image);
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];
	NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@&quot;myfilename.jpg&quot;];
	[imageData writeToFile:dataPath atomically:YES];	
	[self dismissModalViewControllerAnimated:YES];
}</description>
		<content:encoded><![CDATA[<p>Hi Frankie,<br />
There is lots of sample code out there for using the imagePicker.  Basically you use some code, like I list below to save the image to the iPhone documents directory.  Then you can point at this image later to upload it somewhere&#8230;</p>
<p>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo<br />
{<br />
	NSLog(@&#8221;image width: %f image height: %f&#8221;, [image size].width, [image size].height);<br />
	NSData * imageData = UIImagePNGRepresentation(image);<br />
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);<br />
	NSString *documentsDirectory = [paths objectAtIndex:0];<br />
	NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"myfilename.jpg"];<br />
	[imageData writeToFile:dataPath atomically:YES];<br />
	[self dismissModalViewControllerAnimated:YES];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frankie</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-7875</link>
		<dc:creator>Frankie</dc:creator>
		<pubDate>Fri, 25 Jun 2010 19:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-7875</guid>
		<description>How would integrate this using imagePickerController?
would have a code sample?</description>
		<content:encoded><![CDATA[<p>How would integrate this using imagePickerController?<br />
would have a code sample?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Romulo</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-6926</link>
		<dc:creator>Romulo</dc:creator>
		<pubDate>Mon, 10 May 2010 15:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-6926</guid>
		<description>if I select an image from the Photo Library, how should I be able to use the setFile ?</description>
		<content:encoded><![CDATA[<p>if I select an image from the Photo Library, how should I be able to use the setFile ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doug</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-6513</link>
		<dc:creator>doug</dc:creator>
		<pubDate>Mon, 12 Apr 2010 20:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-6513</guid>
		<description>Yeah.  Here&#039;s some sample python Google App Engine code with get&#039;s the post data named file.

if (&#039;file&#039; in self.request.POST and 
   self.request.POST.get(&#039;file&#039;, None) is not None and 
   self.request.POST.get(&#039;file&#039;, None).filename):
	
	file_data = self.request.POST.get(&#039;file&#039;).file.read()
	
	image_length = len(file_data)
	
	if image_length &gt; config.max_size:
		self.response.out.write(&quot;IMAGE_TOO_LARGE&quot;)  
		return
	else:
		file_content_type = self.request.POST.get(&#039;file&#039;).type
		file_name = self.request.POST.get(&#039;file&#039;).filename
		 
		try:
			my_model.image = db.Blob(file_data)
			my_model.imageName = file_name
			my_model.imageType = file_content_type
			my_model.imageLength = image_length
			my_model.put()                 
			
		except Exception, e:
			logging.exception(e)
			error = &#039;Image error processing&#039;
			self.response.out.write(&#039;ERROR_PROCESSING_IMAGE&#039;)  
			return

		logging.info(&#039;File name : %s&#039; % file_name)
		logging.info(&#039;Type : %s&#039; % file_content_type)
		logging.info(&#039;Length : %s&#039; % image_length)
self.response.out.write(&#039;SUCCESS&#039;)   


class MyModel(db.Model): 
    image = db.BlobProperty()  
    imageName = db.StringProperty()
    imageType = db.StringProperty()
    imageLength = db.IntegerProperty()</description>
		<content:encoded><![CDATA[<p>Yeah.  Here&#8217;s some sample python Google App Engine code with get&#8217;s the post data named file.</p>
<p>if (&#8216;file&#8217; in self.request.POST and<br />
   self.request.POST.get(&#8216;file&#8217;, None) is not None and<br />
   self.request.POST.get(&#8216;file&#8217;, None).filename):</p>
<p>	file_data = self.request.POST.get(&#8216;file&#8217;).file.read()</p>
<p>	image_length = len(file_data)</p>
<p>	if image_length > config.max_size:<br />
		self.response.out.write(&#8220;IMAGE_TOO_LARGE&#8221;)<br />
		return<br />
	else:<br />
		file_content_type = self.request.POST.get(&#8216;file&#8217;).type<br />
		file_name = self.request.POST.get(&#8216;file&#8217;).filename</p>
<p>		try:<br />
			my_model.image = db.Blob(file_data)<br />
			my_model.imageName = file_name<br />
			my_model.imageType = file_content_type<br />
			my_model.imageLength = image_length<br />
			my_model.put()                 </p>
<p>		except Exception, e:<br />
			logging.exception(e)<br />
			error = &#8216;Image error processing&#8217;<br />
			self.response.out.write(&#8216;ERROR_PROCESSING_IMAGE&#8217;)<br />
			return</p>
<p>		logging.info(&#8216;File name : %s&#8217; % file_name)<br />
		logging.info(&#8216;Type : %s&#8217; % file_content_type)<br />
		logging.info(&#8216;Length : %s&#8217; % image_length)<br />
self.response.out.write(&#8216;SUCCESS&#8217;)   </p>
<p>class MyModel(db.Model):<br />
    image = db.BlobProperty()<br />
    imageName = db.StringProperty()<br />
    imageType = db.StringProperty()<br />
    imageLength = db.IntegerProperty()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spark</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-6010</link>
		<dc:creator>Spark</dc:creator>
		<pubDate>Mon, 08 Mar 2010 09:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-6010</guid>
		<description>Hi Doug and Ben,

Great stuff, I am wondering if it is actually possible to use ASIHTTPRequest to post data from iphone to the Google App Engine&#039;s datastore , and more specifically the google file service https://gae-file-service.appspot.com/

Thanks

Spark</description>
		<content:encoded><![CDATA[<p>Hi Doug and Ben,</p>
<p>Great stuff, I am wondering if it is actually possible to use ASIHTTPRequest to post data from iphone to the Google App Engine&#8217;s datastore , and more specifically the google file service <a href="https://gae-file-service.appspot.com/" rel="nofollow">https://gae-file-service.appspot.com/</a></p>
<p>Thanks</p>
<p>Spark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin</title>
		<link>http://dougdiego.com/2009/04/08/asihttprequest-uploading-photos/comment-page-1/#comment-5804</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 18 Feb 2010 20:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://dougdiego.com/?p=252#comment-5804</guid>
		<description>Hey Doug,
What does the PHP end look like to receive the data? I&#039;ve been having a hard time determining why my file uploads won&#039;t work, if it&#039;s because the way I&#039;m sending it or the way it&#039;s being received..</description>
		<content:encoded><![CDATA[<p>Hey Doug,<br />
What does the PHP end look like to receive the data? I&#8217;ve been having a hard time determining why my file uploads won&#8217;t work, if it&#8217;s because the way I&#8217;m sending it or the way it&#8217;s being received..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
