<?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: Sending byteArray and variables to server-side script at the same time</title>
	<atom:link href="http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Tue, 16 Mar 2010 21:49:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paulo</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-4849</link>
		<dc:creator>Paulo</dc:creator>
		<pubDate>Mon, 01 Mar 2010 11:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-4849</guid>
		<description>Thanks a lot. works like a charm, so damn simple, hehe.

I just needed to add to the previous code before the &quot;saveToFile(filename, bytes); :

&quot;String filename = request.getParameter(&quot;filename&quot;);&quot;
for getting the filename parameter for example :D</description>
		<content:encoded><![CDATA[<p>Thanks a lot. works like a charm, so damn simple, hehe.</p>
<p>I just needed to add to the previous code before the &#8220;saveToFile(filename, bytes); :</p>
<p>&#8220;String filename = request.getParameter(&#8220;filename&#8221;);&#8221;<br />
for getting the filename parameter for example <img src='http://www.zedia.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paulo</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-4848</link>
		<dc:creator>Paulo</dc:creator>
		<pubDate>Mon, 01 Mar 2010 09:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-4848</guid>
		<description>&lt;a href=&quot;#comment-4468&quot; rel=&quot;nofollow&quot;&gt;@ Michael&lt;/a&gt; 
Hi Michael

Here&#039;s what I do to get the byteArray from server side in Java, with a servlet. This actually works, unless I missed something on the editing here.

public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		response.setContentType(&quot;text/plain&quot;);
		//response.setContentType(&quot;APPLICATION/OCTET-STREAM&quot;);
		PrintWriter out = response.getWriter();
		
		ServletInputStream servletInput = request.getInputStream();
		
		int size = request.getContentLength();
		byte[] bytes = new byte[size];
		
                //here the read method reads the stream and writes to the given byte[]
		servletInput.read(bytes);
                
                //this function just writes the byte[] it into a file, you can do whatever with the bytes, this is just an example.
		saveToFile(filename,bytes);
			
                 //should send something relevant, back to the response
		out.print(filename);
		out.flush();
		out.close();
	}</description>
		<content:encoded><![CDATA[<p><a href="#comment-4468" rel="nofollow">@ Michael</a><br />
Hi Michael</p>
<p>Here&#8217;s what I do to get the byteArray from server side in Java, with a servlet. This actually works, unless I missed something on the editing here.</p>
<p>public void doPost(HttpServletRequest request, HttpServletResponse response)<br />
			throws ServletException, IOException {</p>
<p>		response.setContentType(&#8220;text/plain&#8221;);<br />
		//response.setContentType(&#8220;APPLICATION/OCTET-STREAM&#8221;);<br />
		PrintWriter out = response.getWriter();</p>
<p>		ServletInputStream servletInput = request.getInputStream();</p>
<p>		int size = request.getContentLength();<br />
		byte[] bytes = new byte[size];</p>
<p>                //here the read method reads the stream and writes to the given byte[]<br />
		servletInput.read(bytes);</p>
<p>                //this function just writes the byte[] it into a file, you can do whatever with the bytes, this is just an example.<br />
		saveToFile(filename,bytes);</p>
<p>                 //should send something relevant, back to the response<br />
		out.print(filename);<br />
		out.flush();<br />
		out.close();<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-4468</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 01 Dec 2009 16:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-4468</guid>
		<description>do you have an example of the server-side script involved?</description>
		<content:encoded><![CDATA[<p>do you have an example of the server-side script involved?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sungchul</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-4243</link>
		<dc:creator>sungchul</dc:creator>
		<pubDate>Fri, 13 Nov 2009 09:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-4243</guid>
		<description>hi.. thanks for sharing..

how to get byteArray data in server-side-script.
it has no variable name... ^^..</description>
		<content:encoded><![CDATA[<p>hi.. thanks for sharing..</p>
<p>how to get byteArray data in server-side-script.<br />
it has no variable name&#8230; ^^..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aben</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-4010</link>
		<dc:creator>aben</dc:creator>
		<pubDate>Fri, 25 Sep 2009 18:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-4010</guid>
		<description>thanks for the post. i tried your code for the one where it sends a bytearray. but nothing seems to happen. heres my flex side....

var bitmapData:BitmapData = new BitmapData(txt.width, txt.height);
				bitmapData.draw(txt);
				var jpg:JPEGEncoder = new JPEGEncoder();
				var byteArray:ByteArray = jpg.encode(bitmapData);
				
				var request:URLRequest = new URLRequest(&quot;http://[xxxxx]/Uploader.ashx&quot;);
		      	request.method = URLRequestMethod.POST;		 
		      	request.data = byteArray;
		      	
		      	var loader:URLLoader = new URLLoader();		 
		      	loader.load(request);
				return;</description>
		<content:encoded><![CDATA[<p>thanks for the post. i tried your code for the one where it sends a bytearray. but nothing seems to happen. heres my flex side&#8230;.</p>
<p>var bitmapData:BitmapData = new BitmapData(txt.width, txt.height);<br />
				bitmapData.draw(txt);<br />
				var jpg:JPEGEncoder = new JPEGEncoder();<br />
				var byteArray:ByteArray = jpg.encode(bitmapData);</p>
<p>				var request:URLRequest = new URLRequest(&#8220;http://[xxxxx]/Uploader.ashx&#8221;);<br />
		      	request.method = URLRequestMethod.POST;<br />
		      	request.data = byteArray;</p>
<p>		      	var loader:URLLoader = new URLLoader();<br />
		      	loader.load(request);<br />
				return;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Veronique</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-3851</link>
		<dc:creator>Veronique</dc:creator>
		<pubDate>Thu, 16 Jul 2009 22:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-3851</guid>
		<description>Thank you for the post. I have been using it for project where I let users upload images. If the images are larger than 1MB, I resize them on the fly using Matrix and load the bytes.
All of this works. However the URLLoader doesn&#039;t fire up events until after the image is loaded and displays the bytesLoaded and bytesTotal at 2. Any idea why it would do that and how to fix it.
Thanks.</description>
		<content:encoded><![CDATA[<p>Thank you for the post. I have been using it for project where I let users upload images. If the images are larger than 1MB, I resize them on the fly using Matrix and load the bytes.<br />
All of this works. However the URLLoader doesn&#8217;t fire up events until after the image is loaded and displays the bytesLoaded and bytesTotal at 2. Any idea why it would do that and how to fix it.<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: boxbuilder</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-3824</link>
		<dc:creator>boxbuilder</dc:creator>
		<pubDate>Thu, 09 Jul 2009 09:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-3824</guid>
		<description>ok, but if I need to send variables by POST?</description>
		<content:encoded><![CDATA[<p>ok, but if I need to send variables by POST?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-3765</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 29 Jun 2009 00:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-3765</guid>
		<description>Of course! So simple. Thanks for the hint.</description>
		<content:encoded><![CDATA[<p>Of course! So simple. Thanks for the hint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pushpa</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-3671</link>
		<dc:creator>pushpa</dc:creator>
		<pubDate>Mon, 15 Jun 2009 13:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-3671</guid>
		<description>hi

i am creating a drawing application in as3. i want to send the bitmap as an email attachment. i duno php. can u please provide me with a example and source. 

thanks a lot</description>
		<content:encoded><![CDATA[<p>hi</p>
<p>i am creating a drawing application in as3. i want to send the bitmap as an email attachment. i duno php. can u please provide me with a example and source. </p>
<p>thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: till</title>
		<link>http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/comment-page-1/#comment-3644</link>
		<dc:creator>till</dc:creator>
		<pubDate>Tue, 09 Jun 2009 11:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.zedia.net/?p=222#comment-3644</guid>
		<description>Thanks for sharing!</description>
		<content:encoded><![CDATA[<p>Thanks for sharing!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
