Solved

Form file input - differences Netscape / IE and Windows / Linux

Posted on 2002-04-10
7
207 Views
Last Modified: 2013-12-25
Greetings,

I have the simplest of forms:

<form name="selcfg" method="post" action="./my.cgi" enctype="multipart/form-data">
<input type="FILE">
<input type="submit">
</form>

The issue is the FILE type input. There are several differences in how this is handled, prompting the following questions:

1) When the file upload dialog opens, can I control the default "files of type"? On IE it's "All Files (*.*)", on Netscape it's "HTML Files". I'd prefer choosing my type.

2) Can I control the starting directory of the file upload dialog? On IE its My Computer, on Netscape it's a directory that is part of the Netscape tree.

Finally, and MOST IMPORTANTLY:

3) On Windows (Netscape or IE) my CGI script gets the fully qualified file path name: "\yada\yada\myfile".

On Linux (Netscape) my CGI script gets only the file name, no path: "myfile". Can that be changed?

My CGI script is written in Python, by the way.

Thanks!
NC
0
Comment
Question by:nchenkin
  • 4
  • 3
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6933480
1) no
2) no
3) no
0
 

Author Comment

by:nchenkin
ID: 6934225
ahoffmanm,

Yes, I was afraid of that. While shaving this morning (I get my best ideas while shaving) I was thinking that there may be a JavaScript way of accomplishing at least some of this. I'll pursue that a bit as well.

- NC
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6934260
well, you may try with JavaScript, ActiveX, Java-Applets, Tcl/TK, orwhateverthebrowseraccepts ...
But I think you know how much dragons you have to beat to get it working for any browser on any OS.

My suggestion: simply forget thinking about it
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:nchenkin
ID: 6934284
Yeah, I'll probably forget about 1) and 2). Three is what I really care about -I won't get into the details of why-  and that *might* be easy. Grab the fully qualified filename from the file input and stash in it in a hidden field inside an onClick function. Could work.

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 6934329
ok, I don't know exactly
but I assume that it's not easy'cause these dialog boxes a controls of the underlaying OS. So there might be a chance for any browser on M$ with ActiveX if it can modify the OS settings (urgh, does someone allow this?).

On Unix NS might also be possible, have a look at http://developer.netscape.com/ (don't exactly know where) 'cause NS has a sophisticated API to it's browser (at least up to 4.x, and with 6.x it's JavaScript anyway).

AFAIK lynx, w3m, arachne cannot be modified.

Opera will be a challange, 'cause it might identify as IE or NS or whatever ;-)

It *might* be possible, sometimes, somehow, ...
0
 

Author Comment

by:nchenkin
ID: 6935092
Well, it looks like I can do the JavaScript thing to get the fully qualified filename. Not totally tested yet, but first blush looks good. I need to move on to something else right now, so will have to table this for a few days.

Thanks for your time. Here are the points.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6935115
well, feel free to come back to your question ;-)
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question