<?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: Using the Facebook API to upload photos</title>
	<atom:link href="http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/</link>
	<description>A blog about killer code</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:11:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Axesh R Ajmera (Unlabeled)</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1290</link>
		<dc:creator>Axesh R Ajmera (Unlabeled)</dc:creator>
		<pubDate>Thu, 24 Jun 2010 21:52:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1290</guid>
		<description>Hi,
i have tried the above script but it seems liek i get 200 OK response but the photos does not get uploaded

the following is the response i get

200 User must have accepted TOS method photos.upload api_keyxxx
call_id 1277415658.9678 format XML uid xxxx v 1.0 sig e324c4e6c9b67a1adfab4c33af5970a0 



so i am unable to understand what is the issue


Also how do i get the userid:-


I saw the facebook documentation in your code the BIGINT implies you must be storing the user id in database

The following is my script code
kindly let me know the places where i am making errors


 &#039;photos.upload&#039;,  
	&#039;v&#039;=&gt; $ver,  
	&#039;api_key&#039; =&gt; $key,  
	&#039;uid&#039; =&gt; $uid,  
	&#039;call_id&#039; =&gt; $cid,  
	&#039;format&#039; =&gt; &#039;XML&#039;  
	);
	signRequest($args, $sec);  
	$args[basename($file)] = &#039;@&#039;.realpath($file);  

	$ch = curl_init();
	$url = &#039;http://api.facebook.com/restserver.php?method=photos.upload&#039;;  
	curl_setopt($ch, CURLOPT_URL, $url);  
	curl_setopt($ch, CURLOPT_HEADER, false);  
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
	curl_setopt($ch, CURLOPT_POST, true);  
	curl_setopt($ch, CURLOPT_POSTFIELDS, $args);  
	$data = curl_exec($ch);  

	echo $data;  
	
	function signRequest(&amp;$args, $secret){  
	ksort($args);  
	$sig = &#039;&#039;;  
	foreach($args as $k =&gt; $v){  
	$sig .= $k . &#039;=&#039; . $v;  
	}  
	$sig .= $secret;  
	$args[ &#039;sig&#039;] = md5($sig);  
	} 





?&gt;</description>
		<content:encoded><![CDATA[<p>Hi,<br />
i have tried the above script but it seems liek i get 200 OK response but the photos does not get uploaded</p>
<p>the following is the response i get</p>
<p>200 User must have accepted TOS method photos.upload api_keyxxx<br />
call_id 1277415658.9678 format XML uid xxxx v 1.0 sig e324c4e6c9b67a1adfab4c33af5970a0 </p>
<p>so i am unable to understand what is the issue</p>
<p>Also how do i get the userid:-</p>
<p>I saw the facebook documentation in your code the BIGINT implies you must be storing the user id in database</p>
<p>The following is my script code<br />
kindly let me know the places where i am making errors</p>
<p> &#8216;photos.upload&#8217;,<br />
	&#8216;v&#8217;=&gt; $ver,<br />
	&#8216;api_key&#8217; =&gt; $key,<br />
	&#8216;uid&#8217; =&gt; $uid,<br />
	&#8216;call_id&#8217; =&gt; $cid,<br />
	&#8216;format&#8217; =&gt; &#8216;XML&#8217;<br />
	);<br />
	signRequest($args, $sec);<br />
	$args[basename($file)] = &#8216;@&#8217;.realpath($file);  </p>
<p>	$ch = curl_init();<br />
	$url = &#8216;http://api.facebook.com/restserver.php?method=photos.upload&#8217;;<br />
	curl_setopt($ch, CURLOPT_URL, $url);<br />
	curl_setopt($ch, CURLOPT_HEADER, false);<br />
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
	curl_setopt($ch, CURLOPT_POST, true);<br />
	curl_setopt($ch, CURLOPT_POSTFIELDS, $args);<br />
	$data = curl_exec($ch);  </p>
<p>	echo $data;  </p>
<p>	function signRequest(&amp;$args, $secret){<br />
	ksort($args);<br />
	$sig = &#8221;;<br />
	foreach($args as $k =&gt; $v){<br />
	$sig .= $k . &#8216;=&#8217; . $v;<br />
	}<br />
	$sig .= $secret;<br />
	$args[ 'sig'] = md5($sig);<br />
	} </p>
<p>?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1276</link>
		<dc:creator>Praveen</dc:creator>
		<pubDate>Sat, 05 Jun 2010 14:43:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1276</guid>
		<description>can you share the code to upload photos to facebook from c++</description>
		<content:encoded><![CDATA[<p>can you share the code to upload photos to facebook from c++</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Isman Ramadhan</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1264</link>
		<dc:creator>Isman Ramadhan</dc:creator>
		<pubDate>Thu, 20 May 2010 11:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1264</guid>
		<description>Hi,Thank You for script it&#039;s works fine!i useful it...cheers :)</description>
		<content:encoded><![CDATA[<p>Hi,Thank You for script it&#8217;s works fine!i useful it&#8230;cheers :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe Sweet</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1255</link>
		<dc:creator>Moe Sweet</dc:creator>
		<pubDate>Sat, 01 May 2010 19:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1255</guid>
		<description>So that we could upload photos to facebook from an external website.

How could we display them back?
Care for a block of sample code?</description>
		<content:encoded><![CDATA[<p>So that we could upload photos to facebook from an external website.</p>
<p>How could we display them back?<br />
Care for a block of sample code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaisen</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1244</link>
		<dc:creator>jaisen</dc:creator>
		<pubDate>Thu, 25 Mar 2010 04:42:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1244</guid>
		<description>You don&#039;t need any code.  Here are the docs: http://wiki.developers.facebook.com/index.php/Extended_permissions

The user has to visit the link in the docs and allow your application extended permissions.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t need any code.  Here are the docs: <a href="http://wiki.developers.facebook.com/index.php/Extended_permissions" rel="nofollow">http://wiki.developers.facebook.com/index.php/Extended_permissions</a></p>
<p>The user has to visit the link in the docs and allow your application extended permissions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bruno</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1243</link>
		<dc:creator>bruno</dc:creator>
		<pubDate>Thu, 25 Mar 2010 03:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1243</guid>
		<description>Jaisen, Thanks fot the script. It works fine..

Can u please explain me how to do what u said to Alicia

&quot;@Alicia - Yes, if you want to post photos directly to someone facebook album, they’ll need to install the app. You only need them to grant special permissions if you want to bypass the default “pending” status. If they allow photo upload permissions to your app, then the photos will be active immediately.&quot;

( if u could post the code. Im a newbie and when i get an error i spend hours looking for the error on the web and most of the times are easy to fix, but i dont know how and i google it)

Thanks and greetings from portugal to u all..</description>
		<content:encoded><![CDATA[<p>Jaisen, Thanks fot the script. It works fine..</p>
<p>Can u please explain me how to do what u said to Alicia</p>
<p>&#8220;@Alicia &#8211; Yes, if you want to post photos directly to someone facebook album, they’ll need to install the app. You only need them to grant special permissions if you want to bypass the default “pending” status. If they allow photo upload permissions to your app, then the photos will be active immediately.&#8221;</p>
<p>( if u could post the code. Im a newbie and when i get an error i spend hours looking for the error on the web and most of the times are easy to fix, but i dont know how and i google it)</p>
<p>Thanks and greetings from portugal to u all..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bill</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1241</link>
		<dc:creator>bill</dc:creator>
		<pubDate>Sat, 20 Mar 2010 17:54:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1241</guid>
		<description>Hi jaisen. I always got the Unknown method error when I sent the MIME code to REST. This is part of MIME code:

&quot;Content-Type: multipart/form-data; boundary=just2ed56372-62cfd8bnutz
MIME-version: 1.0

--just2ed56372-62cfd8bnutz
Content-Disposition: form-data; name=&quot;method&quot;

facebook.Photos.upload
--just2ed56372-62cfd8bnutz
Content-Disposition: form-data; name=&quot;api_key&quot;

679d937874fb9c2194f5492da3dcae
--just2ed56372-62cfd8bnutz
&quot;
I&#039;m pretty sure the spelling of the upload method should be ok. Could you check where the problem is? FYI, I use C++.</description>
		<content:encoded><![CDATA[<p>Hi jaisen. I always got the Unknown method error when I sent the MIME code to REST. This is part of MIME code:</p>
<p>&#8220;Content-Type: multipart/form-data; boundary=just2ed56372-62cfd8bnutz<br />
MIME-version: 1.0</p>
<p>&#8211;just2ed56372-62cfd8bnutz<br />
Content-Disposition: form-data; name=&#8221;method&#8221;</p>
<p>facebook.Photos.upload<br />
&#8211;just2ed56372-62cfd8bnutz<br />
Content-Disposition: form-data; name=&#8221;api_key&#8221;</p>
<p>679d937874fb9c2194f5492da3dcae<br />
&#8211;just2ed56372-62cfd8bnutz<br />
&#8221;<br />
I&#8217;m pretty sure the spelling of the upload method should be ok. Could you check where the problem is? FYI, I use C++.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaio Nassar</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1238</link>
		<dc:creator>Vaio Nassar</dc:creator>
		<pubDate>Thu, 18 Mar 2010 21:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1238</guid>
		<description>Yes, that is what I mean, by user page I mean the feed in his profile (wall). So I think I have to look for a method to make fb display last uploaded photo instead of grouping the whole images from the album.
Thanks again</description>
		<content:encoded><![CDATA[<p>Yes, that is what I mean, by user page I mean the feed in his profile (wall). So I think I have to look for a method to make fb display last uploaded photo instead of grouping the whole images from the album.<br />
Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaisen</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1237</link>
		<dc:creator>jaisen</dc:creator>
		<pubDate>Thu, 18 Mar 2010 18:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1237</guid>
		<description>@Vaio, Not sure I understand what you&#039;re aiming to do.  What&#039;s the &quot;user page&quot;?  You can upload one photo per album.  But there&#039;s no guarantee that Facebook won&#039;t group them in the feed.  In fact, I expect that they would group them by default.</description>
		<content:encoded><![CDATA[<p>@Vaio, Not sure I understand what you&#8217;re aiming to do.  What&#8217;s the &#8220;user page&#8221;?  You can upload one photo per album.  But there&#8217;s no guarantee that Facebook won&#8217;t group them in the feed.  In fact, I expect that they would group them by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaio Nassar</title>
		<link>http://www.jaisenmathai.com/blog/2008/11/27/using-the-facebook-api-to-upload-photos/comment-page-1/#comment-1235</link>
		<dc:creator>Vaio Nassar</dc:creator>
		<pubDate>Thu, 18 Mar 2010 13:29:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.jaisenmathai.com/blog/?p=46#comment-1235</guid>
		<description>Thank you for the reply,
No this is not my point, I want to display Only the new uploaded photo on the user page, not all the photos in that album,
When I upload photo using this method it is displayed in user profile, that is ok, when I add another one it is displayed together with the old one in the same new post, I just want to publish Single (latest) photo per post. 
Thanx again for your time</description>
		<content:encoded><![CDATA[<p>Thank you for the reply,<br />
No this is not my point, I want to display Only the new uploaded photo on the user page, not all the photos in that album,<br />
When I upload photo using this method it is displayed in user profile, that is ok, when I add another one it is displayed together with the old one in the same new post, I just want to publish Single (latest) photo per post.<br />
Thanx again for your time</p>
]]></content:encoded>
	</item>
</channel>
</rss>
