Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to keep file name in file upload box?

Status
Not open for further replies.

jackjake

Programmer
Apr 15, 2005
8
0
0
US
A user uploads a file and click a button to go to the next page, and then click a button to come back to the file upload page. How can I keep the file name in the file upload box then?
I used filefield() in CGI,
print $query->filefield(-name=>'uploaded_file',
-default=>'starting value',
-size=>50,
-maxlength=>80);

the 'starting value' does not appear.
Any help is appreciated!
 
That is a limitation of the File input type I'm afraid.

- Rieekan
 
yes, the file input field is ignored by browsers, probably for security reasons. I believe the CGI.pm also documetation mentions this.
 
why would you want to do that at the first place?


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
You could do it with a bit of javascript, hold the value in a hidden field, and regenerate the form, have a scriptlet that will set the field value equal to the hidden field value.

--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top