Solved

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

Posted on 2002-04-10
7
200 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now