<?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>Getting Started</title><link>http://forums.asp.net/15.aspx</link><description>The perfect forum for ASP.NET novices. No question too simple! &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=21&amp;amp;c=17" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: upload picture</title><link>http://forums.asp.net/thread/1125660.aspx</link><pubDate>Mon, 28 Nov 2005 18:05:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1125660</guid><dc:creator>ezguy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1125660.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1125660</wfw:commentRss><description>postedFile.SaveAs(Server.MapPath(&amp;quot;./&amp;quot;) &amp;amp; filename)&amp;nbsp; is the way to go man.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: upload picture</title><link>http://forums.asp.net/thread/1125579.aspx</link><pubDate>Mon, 28 Nov 2005 16:48:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1125579</guid><dc:creator>Scott Mitchell</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1125579.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1125579</wfw:commentRss><description>You can also use &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpRequestClassPhysicalApplicationPathTopic.asp"&gt;Request.PhysicalApplicationPath&lt;/a&gt; to get the physical path of the application root. (i.e., C:\Inetpub\wwwroot\MySite\, or whatever).&lt;br&gt;
&lt;br&gt;
A must-read article on paths is &lt;a href="http://west-wind.com/weblog/"&gt;Rick Strahl&lt;/a&gt;'s blog entry &lt;a href="http://west-wind.com/weblog/posts/269.aspx"&gt;Making Sense of ASP.NET Paths&lt;/a&gt;.</description></item><item><title>Re: upload picture</title><link>http://forums.asp.net/thread/1125432.aspx</link><pubDate>Mon, 28 Nov 2005 14:57:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1125432</guid><dc:creator>wunderkinder</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1125432.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1125432</wfw:commentRss><description>postedFile.SaveAs(Server.MapPath("./") &amp;amp; filename)</description></item><item><title>Re: upload picture</title><link>http://forums.asp.net/thread/1125396.aspx</link><pubDate>Mon, 28 Nov 2005 14:28:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1125396</guid><dc:creator>Freakyuno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1125396.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1125396</wfw:commentRss><description>&lt;P&gt;Welcome to ASP.NET&lt;BR&gt;&lt;BR&gt;Take a look at the server.mappath() method.&lt;BR&gt;&lt;BR&gt;To upload a file to a shared hosting server, you need to know the absolute path where your website lives, this will accomplish that for you. :)&lt;BR&gt;&lt;BR&gt;It returns a string like c:\inetpub\wwwroot\account0010101\shared\....&lt;BR&gt;&lt;BR&gt;Thats just an example of course.&lt;/P&gt;</description></item><item><title>upload picture</title><link>http://forums.asp.net/thread/1125184.aspx</link><pubDate>Mon, 28 Nov 2005 09:04:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1125184</guid><dc:creator>tatau</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1125184.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=1125184</wfw:commentRss><description>&lt;P&gt;&lt;U&gt;Edited by XIII&lt;/U&gt;&lt;BR&gt;&lt;BR&gt;Hello.&amp;nbsp; I'm new to ASP.Net and am learning asp.net 1.1 with vb.&amp;nbsp; I bought a book and made a working .aspx page that will upload to my own computer's hard drive.&amp;nbsp; Since I'm trying to learn&amp;nbsp;this for websites that will be published on shared hosting I&amp;nbsp;need help to alter the code so that it'll upload to a folder on my website rather than my own C:\ drive.&lt;BR&gt;&lt;BR&gt;Fpr example if&amp;nbsp;my website&amp;nbsp;name/folder is&amp;nbsp;"WEBSITE" and the folder I want to upload the images is "imagesup"&lt;BR&gt;&lt;BR&gt;Here's the code I'm using:&lt;BR&gt;&lt;BR&gt;&amp;lt;%@ Import Namespace="System.IO" %&amp;gt;&lt;BR&gt;&amp;lt;%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;script language="VB" runat="server"&amp;gt;&lt;BR&gt;Sub Upload(s As Object, e As EventArgs)&lt;BR&gt;&amp;nbsp;If Not (txtUpload.PostedFile Is Nothing) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;Dim postedFile = txtUpload.PostedFile&lt;BR&gt;&amp;nbsp;&amp;nbsp;Dim filename As String = Path.GetFileName(postedFile.FileName)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;postedFile.SaveAs("c:\" &amp;amp; filename)&lt;BR&gt;&amp;nbsp;&amp;nbsp;lblMessage.Text = "File has been uploaded"&lt;BR&gt;&amp;nbsp;End If&lt;BR&gt;End Sub &lt;BR&gt;&amp;lt;/script&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;form enctype="multipart/form-data" runat="server"&amp;gt;&lt;BR&gt;&amp;lt;p&amp;gt;&amp;lt;input id="txtUpload" type="file" runat="server" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;&amp;lt;input id="btnUpload" type="button" value="Upload" OnServerClick="Upload" runat="server" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;p&amp;gt;&amp;lt;asp:Label id="lblMessage" runat="server" /&amp;gt;&amp;lt;/p&amp;gt;&lt;/P&gt;</description></item></channel></rss>