<?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: Fake uploading files</title>
	<atom:link href="http://valokuva.org/?feed=rss2&#038;p=132" rel="self" type="application/rss+xml" />
	<link>http://valokuva.org/?p=132</link>
	<description>My Thoughts Exactly</description>
	<lastBuildDate>Fri, 03 Sep 2010 20:25:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ageno</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-20536</link>
		<dc:creator>Ageno</dc:creator>
		<pubDate>Fri, 03 Sep 2010 20:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-20536</guid>
		<description>I&#039;ve never read about these functions...

It&#039;s really useful, thanx</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never read about these functions&#8230;</p>
<p>It&#8217;s really useful, thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: podarki</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-15904</link>
		<dc:creator>podarki</dc:creator>
		<pubDate>Sun, 23 Aug 2009 08:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-15904</guid>
		<description>Ð’Ð¾Ð¾Ð±Ñ‰Ðµ, Ð½Ð° Ð¼Ð¾Ð¹ Ð²Ð·Ð³Ð»ÑÐ´, ÑÐ°Ð¼Ð¾Ðµ Ð»ÑƒÑ‡ÑˆÐµÐµ Ð² Ð»Ð¸Ñ‡Ð½Ð¾Ð¼ Ð±Ð»Ð¾Ð³Ðµ, Ñ‚Ð°Ðº ÑÑ‚Ð¾ ÑÐ°Ð¼Ð¾Ð¿Ð¾Ð·Ð½Ð°Ð½Ð¸Ðµ.</description>
		<content:encoded><![CDATA[<p>Ð’Ð¾Ð¾Ð±Ñ‰Ðµ, Ð½Ð° Ð¼Ð¾Ð¹ Ð²Ð·Ð³Ð»ÑÐ´, ÑÐ°Ð¼Ð¾Ðµ Ð»ÑƒÑ‡ÑˆÐµÐµ Ð² Ð»Ð¸Ñ‡Ð½Ð¾Ð¼ Ð±Ð»Ð¾Ð³Ðµ, Ñ‚Ð°Ðº ÑÑ‚Ð¾ ÑÐ°Ð¼Ð¾Ð¿Ð¾Ð·Ð½Ð°Ð½Ð¸Ðµ.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mangola</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-14827</link>
		<dc:creator>Mangola</dc:creator>
		<pubDate>Sun, 12 Jul 2009 08:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-14827</guid>
		<description>I added your blog to Google Reader.</description>
		<content:encoded><![CDATA[<p>I added your blog to Google Reader.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-13705</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 26 May 2009 03:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-13705</guid>
		<description>Ignore my previous question. I was able to successfully compile this extension using Microsoft Visual C++ 2008 Express (configured via steps provided on TalkPHP) and ensuring that COMPILE_DL_FAKEUPLOAD was defined.

Awesome extension, solved one of my unit testing headaches!</description>
		<content:encoded><![CDATA[<p>Ignore my previous question. I was able to successfully compile this extension using Microsoft Visual C++ 2008 Express (configured via steps provided on TalkPHP) and ensuring that COMPILE_DL_FAKEUPLOAD was defined.</p>
<p>Awesome extension, solved one of my unit testing headaches!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-13682</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 25 May 2009 06:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-13682</guid>
		<description>Does anyone by chance have a win32 pre-compiled version of this extension?</description>
		<content:encoded><![CDATA[<p>Does anyone by chance have a win32 pre-compiled version of this extension?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-13599</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 23 May 2009 20:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-13599</guid>
		<description>Hi, nice posts there :-) thank&#039;s for the interesting information</description>
		<content:encoded><![CDATA[<p>Hi, nice posts there <img src='http://valokuva.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  thank&#8217;s for the interesting information</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko Koppanen</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-11994</link>
		<dc:creator>Mikko Koppanen</dc:creator>
		<pubDate>Thu, 16 Apr 2009 10:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-11994</guid>
		<description>Hi Alex,

I never tested binary data. Here is an updated version with the fix you provided: http://valokuva.org/php_ext/fakeupload/fakeupload-0.0.2.tgz</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>I never tested binary data. Here is an updated version with the fix you provided: <a href="http://valokuva.org/php_ext/fakeupload/fakeupload-0.0.2.tgz" rel="nofollow">http://valokuva.org/php_ext/fakeupload/fakeupload-0.0.2.tgz</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aljoscha</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-11993</link>
		<dc:creator>Aljoscha</dc:creator>
		<pubDate>Thu, 16 Apr 2009 10:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-11993</guid>
		<description>Hi, this is very useful indeed and works like a charm!
But did you try providing image data file to the fakeupload_file function?
I tried using a base64_decode($base64EncodedImageData) and &#039;image/jpeg&#039; mime type and ended up with a broken image file.
The reason is the usage of fputs for writing the character stream, while the image data can contain  characters.
By using fwrite instead, any binary data can be fake uploaded, like so:
--- php_fakeupload.c.orig	2009-04-16 12:09:10.865504325 +0200
+++ php_fakeupload.c	2009-04-16 12:06:13.141502707 +0200
@@ -69,7 +69,7 @@
 		if (!fp) {
 			error = UPLOAD_ERROR_E;
 		} else {
-			fputs (contents, fp);
+			fwrite (contents, 1, contents_len, fp);
 			fclose(fp);
 		}
 	}
Cheers, Alex</description>
		<content:encoded><![CDATA[<p>Hi, this is very useful indeed and works like a charm!<br />
But did you try providing image data file to the fakeupload_file function?<br />
I tried using a base64_decode($base64EncodedImageData) and &#8216;image/jpeg&#8217; mime type and ended up with a broken image file.<br />
The reason is the usage of fputs for writing the character stream, while the image data can contain  characters.<br />
By using fwrite instead, any binary data can be fake uploaded, like so:<br />
&#8212; php_fakeupload.c.orig	2009-04-16 12:09:10.865504325 +0200<br />
+++ php_fakeupload.c	2009-04-16 12:06:13.141502707 +0200<br />
@@ -69,7 +69,7 @@<br />
 		if (!fp) {<br />
 			error = UPLOAD_ERROR_E;<br />
 		} else {<br />
-			fputs (contents, fp);<br />
+			fwrite (contents, 1, contents_len, fp);<br />
 			fclose(fp);<br />
 		}<br />
 	}<br />
Cheers, Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko Koppanen&#8217;s Blog: Fake uploading files : Dragonfly Networks</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-10072</link>
		<dc:creator>Mikko Koppanen&#8217;s Blog: Fake uploading files : Dragonfly Networks</dc:creator>
		<pubDate>Sat, 07 Mar 2009 08:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-10072</guid>
		<description>[...] Koppanen has posted about an extension he&#8217;s written up that has only one real purpose - to help with unit testing a [...]</description>
		<content:encoded><![CDATA[<p>[...] Koppanen has posted about an extension he&#8217;s written up that has only one real purpose &#8211; to help with unit testing a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko Koppanen</title>
		<link>http://valokuva.org/?p=132&#038;cpage=1#comment-10022</link>
		<dc:creator>Mikko Koppanen</dc:creator>
		<pubDate>Fri, 06 Mar 2009 10:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://valokuva.org/?p=132#comment-10022</guid>
		<description>Giorgio,

The code was written by someone else and I had no intention to touch it further :)</description>
		<content:encoded><![CDATA[<p>Giorgio,</p>
<p>The code was written by someone else and I had no intention to touch it further <img src='http://valokuva.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc (user agent is rejected)
Database Caching 2/17 queries in 0.037 seconds using apc

Served from: valokuva.org @ 2010-09-06 22:49:01 -->