input type = file : question ?

A

Arun Wadhawan

Hello
I would like to include a input type form in my homepage:
But the Browse button only shows the local files on my computer.
I would like to show the Files on the server, where the HTML site is.
Is this possible?



Syntax
<form name="form1" enctype="multipart/form-data" method="post" action="">
<input type="file" name="file">
</form>
 
J

Jan Harders

Arun Wadhawan said:
Hello
I would like to include a input type form in my homepage:
But the Browse button only shows the local files on my computer.
I would like to show the Files on the server, where the HTML site is.
Is this possible?

In short: no!
But you can still build some workaround with javascript, that, when you hit
the browse-button, opens a new window that loads a serverside-script sending
html looking like a filebrowser.
 
S

Steve Pugh

Arun Wadhawan said:
I would like to include a input type form in my homepage:
But the Browse button only shows the local files on my computer.
I would like to show the Files on the server, where the HTML site is.
Is this possible?

The file input is designed to submit files to the server. If the files
are already on the server then they don't need to be submitted as
files, you can just tell the server side script the filename and it
can go and look it up itself (assuming permissions are set, etc.)

It would be very ineffivient to download the file from the server to
the browser and then submit it to the server again.

So I'd suggest forgetting all about the file input for this purpose
and isntead have your server genearate a file listing with checkboxes
that the user can select the file from. The name of this file will
then be submitted and the server can go and do whatever it is you're
doing with it.

Steve
 
W

Webcastmaker

Hello
I would like to include a input type form in my homepage:
But the Browse button only shows the local files on my computer.
I would like to show the Files on the server, where the HTML site is.
Is this possible?

Not like you think, but you can easily create server side script that
will accomplish what you are looking to do. The process completely
depends on what you use on the server (php, asp isapi etc...)
 
D

Dave Patton

Hello
I would like to include a input type form in my homepage:
But the Browse button only shows the local files on my computer.
I would like to show the Files on the server, where the HTML site is.
Is this possible?

Depending on your webserver software, and how it is configured,
it may be as simple as having a link to a directory containing
the files, along with not having an "index document" in that
directory. If your website is http://www.example.com/ then
try creating a directory called, for example, "filelist" under
the root directory for your website, put some files in that
directory(but not index.htm, index.html, etc), then browse to
http://www.example.com/filelist/
You may get a "directory listing denied" message, but you may
be able to reconfigure things to enable a directory listing,
if permitted by your web hosting arrangements.
 

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,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top