Quick simple question

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
NelsonC
Member
Posts: 71
Joined: Mon Sep 17, 2001 11:39 am

Quick simple question

Post by NelsonC »

I am programming a regular basic HTML page

I have a browse button pointing at what files to display.
and once I select the file it adds the path + file name to the textbox

how to I make a submit or open button open the specific file. this is for my use not outside people (local use)

[ text ] (browse button) (submit)

When I click browse I get the directory
I select the file and it lists for example
c:\test\test1.doc

I would like the submit to open that file in work for example how do I do that what is the dam code for the submit?

thanks

n.conceicao@sympatico.ca
cyberskye
Senior Member
Posts: 4717
Joined: Wed Jan 10, 2001 12:00 am
Location: DC

Post by cyberskye »

Post your code. And use more punctuation please - it's easier to follow.
I would like the submit to open that file in work for example how do I do that what is the dam code for the submit?


Do you mean actually open the file on the server or open a local copy of the file on your machine? Honestly, neither is very easy or practical, actually, through the web.

For the client to open a .doc file, s/he needs to be running local software (MS Word, or some other editor that understand doc files) to open the downloaded file.

To work on the file on the server, you want Terminal Server, PCANyware, VNC, etc that allows remote control (for the sam reasons as your other option). There are obvious security concerns here as well.
anything is possible - nothing is free

:wth:
Blisster wrote:It *would* be brokeback bay if I in fact went and hung out with Skye and co (did I mention he is teh hotness?)
:wth:
User avatar
TonyT
SG VIP
Posts: 10356
Joined: Fri Jan 28, 2000 12:00 am
Location: Fairfax, VA

Post by TonyT »

When using <input type="file"

you must also use a server side program to "do something with the file" else all you will be able to at best with an "open" button is get a download prompt or IE will attempt to open the program associated with the file type. IE has built in plugins that allow it to launce Nortepad, Wordpad, MSPaint and some other MS apps. Stuff like multimedia requires the proper plugins installed,

Due to security settings and architecture of IE, this is NOT a good method to use for opening files. It can be done via a web interface, but this requires the use of backend apps like jsp server, php-mysql, asp, macromedia fusion etc etc.
No one has any right to force data on you
and command you to believe it or else.
If it is not true for you, it isn't true.

LRH
NelsonC
Member
Posts: 71
Joined: Mon Sep 17, 2001 11:39 am

Thanks guys

Post by NelsonC »

Actually it's really simple..

it's a html page basic with a browse button
once the button is clicked is shows the local files on the drive.
I am setting this up as an intranet page.. so no server side needed just need the browse button and one the file is selected I would like it to open (in my editor of choice) I assume I would call it somehow..
User avatar
TonyT
SG VIP
Posts: 10356
Joined: Fri Jan 28, 2000 12:00 am
Location: Fairfax, VA

Post by TonyT »

<input type="file"> is for *uploading* files, not downloading them.

At best, using a browser, you can invoke the Save-Save As dialog.

To invoke a Save/Save As dialogue, you need to set things up on a server so that the proper HTTP headers will be sent. This is then added to the form enctype= "". Cannot be done even using javascript.

The value in a file input cannot be manipulated in any way using JavaScript. There's also no way to interact with the "Save/Save As" dialogue from script. Both of these are security measures to keep websites from accessing the contents of uer's hard drives without authorisation.
No one has any right to force data on you
and command you to believe it or else.
If it is not true for you, it isn't true.

LRH
Post Reply