Solved

input type and filename value

Posted on 2000-03-14
1
170 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

20 Experts available now in Live!

Get 1:1 Help Now