Solved

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

Posted on 2002-04-10
7
195 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
Comment Utility
1) no
2) no
3) no
0
 

Author Comment

by:nchenkin
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:nchenkin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
well, feel free to come back to your question ;-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
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…
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now