Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Load contents of a text file into a text box

Reply
Thread Tools

Load contents of a text file into a text box

 
 
Jeremy Chapman
Guest
Posts: n/a
 
      08-15-2003
How can I display a file open dialog by clicking a button in an aspx page,
have the user select a text file then display the contents into a control
such as a text box


 
Reply With Quote
 
 
 
 
Tommy
Guest
Posts: n/a
 
      08-15-2003
I don't know if you could open a file using client-side script. This
don't sound right from a security point of view. However, you can have
the user upload the file to your webform. Your webform then opens the
file on the server, reads its contents, and populate it to the textbox
and return to the client.

The following is some sample HTML code that will show a open file
dialog box on the client-side and allow the user to upload a file.

********************************************
<html>
<body>
<form name="form1" action="form1" enctype="multipart/form-data"
method="post">
<p>
Type some text (if you like):<br>
<input type="text" name="textline" size="30">
</p>
<p>
Please specify a file, or a set of files:<br>
<input type="file" name="datafile">
</p>
<p>
<input type="submit" value="Send">
</p>
</form>
</body>
</html>
********************************************

Tommy,

"Jeremy Chapman" <> wrote in message news:<>...
> How can I display a file open dialog by clicking a button in an aspx page,
> have the user select a text file then display the contents into a control
> such as a text box

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding contents on yaml file without overwriting actual contents Kamarulnizam Rahim Ruby 4 01-28-2011 09:10 AM
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Screen scraping an html text contents into a file basi Ruby 15 12-07-2005 04:44 PM
Moving text file contents into a std::string Dave C++ 4 05-21-2004 05:56 AM
Reading a small text file contents into an array Foxy Kav C++ 6 04-28-2004 01:52 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57