how can I open a local file?

Z

Zhan feng Wang

Hi,friends,
how can I get the path of a local file, so that I can open and read the
file?
in my webpage I have following:
<form name="myInput" method="POST">
<pre>
Select A File: <input name="fname" type="file" value="start">
<input type="button" name="Go" value="Go!" >
</pre>
</form>

And e.g. I will get the fname="/home/wym/exdir/ruby/file1.rb", here the
path if local, how can I get the IP of the local path if my
ip="http://127.0.0.1"?

Thanks
 
D

darren kirby

quoth the Zhan feng Wang:
Hi,friends,
how can I get the path of a local file, so that I can open and read the
file?
in my webpage I have following:
<form name="myInput" method="POST">
<pre>
Select A File: <input name="fname" type="file" value="start">
<input type="button" name="Go" value="Go!" >
</pre>
</form>

And e.g. I will get the fname="/home/wym/exdir/ruby/file1.rb", here the
path if local, how can I get the IP of the local path if my
ip="http://127.0.0.1"?

Thanks

Hi.

I guess you may want to browse the CGI docs. [0], [1]. If that doesn't help
then perhaps you need to formulate your question a bit clearer. I, for one,
am not sure what you mean by "get the IP of the local path".

[0] http://www.ruby-doc.org/core/classes/CGI.html
[1] http://www.whytheluckystiff.net/ruby/pickaxe/html/lib_network.html#S3

-d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top