You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zhiyong Li <Zh...@ibiomatics.com> on 2001/04/26 14:01:24 UTC
Set default file names in the upload
This may not be a direct Struts question. But I hope to get the response
from here ...
In using the file upload, which is <FORM name=frmGroup ACTION=""
METHOD="POST" ENCTYPE="multipart/form-data" onsubmit="return false;">, I
would like to set a default value for the file name. However, I cannot
find a way to accomplish this. These are the approaches I tried;
<input type="FILE" name="F0" size=35 value="aa"
class="propertyDetail"> <br>
or
function setDefaultName(){
document.frmGroup.F0.value="c:\\temp";
}
I am using IE 5. I was told that for the security reason, the browser
does not allow you to do this. I would like to confirm on that.
Thanks for your help,
Zhiyong Li
Platform Development
iBiomatics LLC , a SAS Company
(919) 653-2746
Zhiyong.Li@iBiomatics.com
Re: Set default file names in the upload
Posted by Sean <ja...@wideasleep.com>.
Set default file names in the uploadMy experience with HTML and Forms is that they do NOT allow you to value of a File input form element dynamically or by specifying a default value in the HTML. Yes, this is a security thing and I thank them for that, don't want any strange hidden File elements off screen accidently submitting my Quicken files to a server.
Sean
----- Original Message -----
From: Zhiyong Li
To: struts-user@jakarta.apache.org
Sent: Thursday, April 26, 2001 7:01 AM
Subject: Set default file names in the upload
This may not be a direct Struts question. But I hope to get the response from here ...
In using the file upload, which is <FORM name=frmGroup ACTION="" METHOD="POST" ENCTYPE="multipart/form-data" onsubmit="return false;">, I would like to set a default value for the file name. However, I cannot find a way to accomplish this. These are the approaches I tried;
<input type="FILE" name="F0" size=35 value="aa" class="propertyDetail"> <br>
or
function setDefaultName(){
document.frmGroup.F0.value="c:\\temp";
}
I am using IE 5. I was told that for the security reason, the browser does not allow you to do this. I would like to confirm on that.
Thanks for your help,
Zhiyong Li
Platform Development
iBiomatics LLC , a SAS Company
(919) 653-2746
Zhiyong.Li@iBiomatics.com