<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Silverlike &#187; UploadFile</title>
	<atom:link href="http://silverlike.net/tag/uploadfile/feed/" rel="self" type="application/rss+xml" />
	<link>http://silverlike.net</link>
	<description>We Like Silverlight</description>
	<lastBuildDate>Mon, 07 Dec 2009 06:34:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple File Upload Solution</title>
		<link>http://silverlike.net/simple-file-upload-solution/</link>
		<comments>http://silverlike.net/simple-file-upload-solution/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 12:18:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[UploadFile]]></category>

		<guid isPermaLink="false">http://silverlike.net/simple-file-upload-solution/</guid>
		<description><![CDATA[Gergely Orosz target to implement a simple solution in uploading file using Silverlight. The upload control contains a progress indicator where you can keep track of the upload progress. The sample also showed you how you can collect the uploaded file using PHP or C#.]]></description>
			<content:encoded><![CDATA[<p><a href="http://gregdoesit.com/2009/10/file-upload-in-silverlight-a-simple-solution/" target="_blank">Gergely Orosz</a> target to implement a simple solution in uploading file using Silverlight. The upload control contains a progress indicator where you can keep track of the upload progress. The sample also showed you how you can collect the uploaded file using PHP or C#.</p>
<p class="image"><a href="http://gregdoesit.com/2009/10/file-upload-in-silverlight-a-simple-solution/" target="_blank"><img style="display: inline" title="Simple File Upload Solution" alt="Simple File Upload Solution" src="http://silverlike.net/wp-content/uploads/2009/11/SimpleFileUploadSolution.jpg" width="400" height="250" /></a> </p>
<div class="reference-info"><strong>Website:</strong> <a href="http://silverlike.net/simple-file-upload-solution/" title="http://silverlike.net/simple-file-upload-solution/" target="_blank">Click here</a></div>
<div class="reference-info"><strong>Download:</strong> <a href="http://silverlike.net/simple-file-upload-solution/" title="http://silverlike.net/simple-file-upload-solution/" target="_blank">Click here</a></div>
<img src="http://silverlike.net/?ak_action=api_record_view&id=832&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://silverlike.net/simple-file-upload-solution/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Upload file using File Dialog</title>
		<link>http://silverlike.net/upload-file-using-file-dialog/</link>
		<comments>http://silverlike.net/upload-file-using-file-dialog/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 06:52:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[UploadFile]]></category>

		<guid isPermaLink="false">http://silverlike.net/upload-file-using-file-dialog/</guid>
		<description><![CDATA[The coding below demonstrating how you might utilize your FileDialog to upload files from your local disk to server.]]></description>
			<content:encoded><![CDATA[<p>The coding below demonstrating how you might utilize your FileDialog to upload files from your local disk to server. </p>
<p>The code demonstrated the following: </p>
<ol>
<li>Limited the selection of JPG and PNG files only </li>
<li>Only 1 file can be selected </li>
<li>Upload the file with the corresponding file name </li>
<li>How to get the file data inside PHP </li>
</ol>
<p class="image"><a class="thickbox" href="http://www.shinedraw.com"><img style="display: inline" title="Upload file using File Dialog" alt="Upload file using File Dialog" src="http://silverlike.net/wp-content/uploads/2009/09/UploadfileusingFileDialog_thumb.jpg" width="400" height="250" /></a>&#160;</p>
<div class="csharp-area">Select and upload file in c#: </div>
<pre class="brush: c-sharp;">OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = &quot;Image Files (.jpg,.png)|*.JPG;*.jpg;*.PNG;*.png&quot;;
dialog.FilterIndex = 1;
bool? userClickedOK = _imageDialog.ShowDialog();

// Process input if the user clicked OK.
if (userClickedOK == true)
{
    UploadFile(dialog.File.Name, dialog.File.OpenRead());
}

private void UploadFile(string filename, Stream data)
{
    UriBuilder ub = new UriBuilder(UPLOAD_PATH);
    ub.Query = string.Format(&quot;filename={0}&quot;, filename);

    WebClient c = new WebClient();
    c.OpenWriteCompleted += (sender, e) =&gt;
    {
        PushData(data, e.Result);
        e.Result.Close();
        data.Close();
    };
    c.OpenWriteAsync(ub.Uri, &quot;Post&quot;);
}

private void PushData(Stream input, Stream output)
{
    byte[] buffer = new byte[4096];
    int bytesRead;

    while ((bytesRead = input.Read(buffer, 0, buffer.Length)) != 0)
    {
        output.Write(buffer, 0, bytesRead);
    }
}</pre>
<div class="xaml-area">Get and save file in PHP: </div>
<pre class="brush: c-sharp;">
$filepath = $_REQUEST['filename'];
$handle = fopen(&quot;php://input&quot;, &quot;r&quot;);
$file = fopen($filepath,&quot;w&quot;);

if($file != null &amp;&amp; $handle != null)
{
        while ($data = fread($handle, 8192)) fwrite($file, $data);
        fclose($handle);
        fclose($file);
}</pre>
<div class="reference-info"><strong>Website:</strong> <a href="http://silverlike.net/upload-file-using-file-dialog/" title="http://silverlike.net/upload-file-using-file-dialog/" target="_blank">Click here</a></div>
<img src="http://silverlike.net/?ak_action=api_record_view&id=454&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://silverlike.net/upload-file-using-file-dialog/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!--
This site's performance optimized by W3 Total Cache:

W3 Total Cache improves the user experience of your blog by caching
frequent operations, reducing the weight of various files and providing
transparent content delivery network integration.

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk

Served from: shareelements.silverlighteffect.com @ 2012-05-19 02:40:02 -->
