Solved

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

Posted on 2002-04-10
7
209 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

733 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