Solved

input type and filename value

Posted on 2000-03-14
1
201 Views
Last Modified: 2010-05-18
i have code that prints out a html form that will
send a file to a cgi script but id like
to do an error check and when someone leaves
out one of the options they will be sent
back to the same script and whatever
they filled in before will be filled in again

i tried this with:

 It was $textfile<br>     <input type="file" name="fileName" value="$textfile"><BR>

now with all the other fields (which we just text boxes and drop down menus) this method of assigning value to be some value (ie value="$previous_entry1") worked every time but not for when i try
to have an entry for a file.....

in the code

 It was $textfile<br>     <input type="file" name="fileName" value="$textfile"><BR>

it prints out what $textfile was but it will not put the value of $textfile in the textbox.....

ie it says
it was text.txt (and then it prints and empty text box - with no "text.txt"

how do i get it to put the value into the textbox?


               
0
Comment
Question by:boofulls
1 Comment
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
ID: 2615485
although the HTML spec says you can put a value in a file control browsers actually ignore it for security reasons

activstate perl help says

'For security reasons, browsers don't pay any attention to this field, and so the starting value will always be blank. Worse, the field loses its ``sticky'' behavior and forgets its previous contents. The starting value field is called for in the HTML specification, however, and possibly some browser will eventually provide support for it.'


im sorry mate.. it cannt be done .. well not yet any way. browsers may eventually allow this....
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl CPAN issue 3 117
Perl Write to Specific line in a file 15 106
Export Variables in Perl 3 87
read an xml file in perl 2 51
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

808 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