Solved

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

Posted on 2002-04-10
7
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

724 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