<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Migrating from PHP to ASP.NET</title><link>http://forums.asp.net/44.aspx</link><description>Discuss moving from PHP to ASP.NET.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Convert simple PHP code to ASP.NET</title><link>http://forums.asp.net/thread/3266890.aspx</link><pubDate>Tue, 30 Jun 2009 15:17:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3266890</guid><dc:creator>guddie</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3266890.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=44&amp;PostID=3266890</wfw:commentRss><description>&lt;p&gt;I set validateRequest=false in the Page directive in Web.config and it works fine now. Thanks for the help!&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert simple PHP code to ASP.NET</title><link>http://forums.asp.net/thread/3266865.aspx</link><pubDate>Tue, 30 Jun 2009 15:09:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3266865</guid><dc:creator>guddie</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3266865.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=44&amp;PostID=3266865</wfw:commentRss><description>&lt;p&gt;Very close, but I get this error instead of the file:&lt;/p&gt;&lt;p&gt;&lt;span&gt;
&lt;h1&gt;Server Error in &amp;#39;/websvc&amp;#39; Application.
&lt;hr /&gt;
&lt;/h1&gt;
&lt;h2&gt;&lt;i&gt;A potentially dangerous Request.Form value was detected from the client 
(=&amp;quot;...�֧M�&#x1;&#x10;�B�m&amp;lt;M���&#x1F;��k�I�j�Vkk���...&amp;quot;).&lt;/i&gt; &lt;/h2&gt;&lt;/span&gt;&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;&lt;b&gt;Description: 
&lt;/b&gt;Request Validation has detected a potentially dangerous client input value, 
and processing of the request has been aborted. This value may indicate an 
attempt to compromise the security of your application, such as a cross-site 
scripting attack. You can disable request validation by setting 
validateRequest=false in the Page directive or in the configuration 
section. However, it is strongly recommended that your application explicitly 
check all inputs in this case. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exception Details: 
&lt;/b&gt;System.Web.HttpRequestValidationException: A potentially dangerous 
Request.Form value was detected from the client 
(=&amp;quot;...�֧M�&#x1;&#x10;�B�m&amp;lt;M���&#x1F;��k�I�j�Vkk���...&amp;quot;).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; 
&lt;br /&gt;&lt;br /&gt;
&lt;table class="mceItemTable" bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;The source code that generated this unhandled exception can only be 
shown when compiled in debug mode. To enable this, please follow one of the 
below steps, then request the URL:&lt;br /&gt;&lt;br /&gt;1. Add a &amp;quot;Debug=true&amp;quot; directive at the 
top of the file that generated the error. Example:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;%@ Page 
Language=&amp;quot;C#&amp;quot; Debug=&amp;quot;true&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;or:&lt;br /&gt;&lt;br /&gt;2) Add the following section 
to the configuration file of your 
application:&lt;br /&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;compilation 
debug=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;Note 
that this second technique will cause all files within a given application to be 
compiled in debug mode. The first technique will cause only that particular file 
to be compiled in debug mode.&lt;br /&gt;&lt;br /&gt;Important: Running applications in debug 
mode does incur a memory/performance overhead. You should make sure that an 
application has debugging disabled before deploying into production 
scenario.&lt;/code&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;Stack Trace:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table class="mceItemTable" bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (=&amp;quot;...�֧M�&#x1;&#x10;�B�m&amp;lt;M���&#x1F;��k�I�j�Vkk���...&amp;quot;).]&lt;br /&gt;   System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +8721914&lt;br /&gt;   System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +111&lt;br /&gt;   System.Web.HttpRequest.get_Form() +129&lt;br /&gt;   System.Web.HttpRequest.get_HasForm() +8722023&lt;br /&gt;   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97&lt;br /&gt;   System.Web.UI.Page.DeterminePostBackMode() +63&lt;br /&gt;   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785&lt;br /&gt;   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242&lt;br /&gt;   System.Web.UI.Page.ProcessRequest() +80&lt;br /&gt;   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21&lt;br /&gt;   System.Web.UI.Page.ProcessRequest(HttpContext context) +49&lt;br /&gt;   ASP.createpng_aspx.ProcessRequest(HttpContext context) +37&lt;br /&gt;   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181&lt;br /&gt;   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +75&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;
&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;&lt;b&gt;Version Information:&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.3082; 
ASP.NET Version:2.0.50727.3082 &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt="" /&gt;&lt;/p&gt;&lt;div style="overflow:hidden;position:absolute;left:-10000px;top:0px;width:1px;height:1px;" id="_mcePaste"&gt;&lt;i&gt;A potentially dangerous Request.Form value was detected from the client 
(=&amp;quot;...�֧M�&#x1;&#x10;�B�m&amp;lt;M���&#x1F;��k�I�j�Vkk���...&amp;quot;).&lt;/i&gt; &lt;/div&gt;</description></item><item><title>Re: Convert simple PHP code to ASP.NET</title><link>http://forums.asp.net/thread/3258992.aspx</link><pubDate>Fri, 26 Jun 2009 01:05:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3258992</guid><dc:creator>Argg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3258992.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=44&amp;PostID=3258992</wfw:commentRss><description>&lt;pre style="white-space:pre-wrap;" id="ctl00_MTContentSelector1_mainContentContainer_ctl31JScript"&gt;&lt;pre name="code" class="c-sharp"&gt;Response.Clear();
Response.ContentType = &amp;quot;application/png&amp;quot;;
Response.AddHeader(&amp;quot;Content-Disposition&amp;quot;, &amp;quot;attachment; filename=exportedmap.png&amp;quot;);
Response.BinaryWrite(myByteArray);&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;That should get you close if not solve your problem&lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Convert simple PHP code to ASP.NET</title><link>http://forums.asp.net/thread/3258836.aspx</link><pubDate>Thu, 25 Jun 2009 21:52:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3258836</guid><dc:creator>guddie</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3258836.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=44&amp;PostID=3258836</wfw:commentRss><description>&lt;p&gt;I have the following PHP code that needs to be converted to ASP.NET:&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;header(&amp;#39;Content-disposition: attachment; filename=exportedmap.png&amp;#39;);&lt;br /&gt;header(&amp;quot;Content-type: application/png&amp;quot;);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;readfile(&amp;#39;php://input&amp;#39;);&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;Basically it is taking a ByteArray from an Adobe Flex application, converting it to a PNG file, and handing that back to the client in the form of a &amp;quot;Open/Save File&amp;quot; browser dialog. Any help would be much appreciated.&lt;/p&gt;</description></item></channel></rss>