Newton wrote:
I am programming in Visual studio ASP.NET using C#. I am using Visual Studio
environment, so I am writing only handlers for buttons and other components.
I would like to make that if user will click on button on my web page, he
will have possibility to choose some file from his filesystem on his hard
disk...
And if there is also posibility if I can read that file as an XML document?
Which components or objects shoud I use for these situations? Could you
recommend me some web page with some examples of these?
How about learning HTML and HTTP and that ASP.NET is just a server side
object model that can receive HTTP requests and make HTTP responses
(where then the response body can be a HTML document)?
HTML has the
<input type="file">
element that you can insert inside of a HTML <form> element to allow the
user to upload files.
So in terms of ASP.NET you need to use a HtmlInputFile control in the
namespace System.Web.UI.HtmlControls, that control has a property
PostedFile which is an instance of HttpPostedFile which for instance has
a property InputStream which you could need to load the posted data into
an System.Xml.XmlDocument or an XmlTextReader.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIHtmlControlsHtmlInputFileClassTopi c.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIHtmlControlsHtmlInputFileClassPost edFileTopic.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpPostedFileClassTopic.asp>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/