J
JeffDotNet
My users need to upload a specific type of file and I would like to assist
them in finding the appropriate file. I don’t believe there is an out of the
box way to filter the files that will be listed in the browsers file browser
dialog. I did however notice that if a user types a filter in the textbox
associated with the fileUpload control (ex: ‘*weeklyStatusReport*.xml’) and
then clicks browse, that this is able to filter the displayed files. This
may only work in internet explorer but for my intranet application this could
be useful. The problem I run into is that I would like to fill in the
textbox associated with the fileUpload control for the user and this is
proving more difficult than I had expected.
I have read access to the file in the textbox with javascript:
var uploader= document.getElementById('<%=Me.FileUpload1.ClientID%>');
if (uploader.value =='')
{args.IsValid=false;
uploader.value=’someText’
Doesn’t produce an error but it doesn’t work either.
I know that there is some protection here to keep asp from uploading files
the users doesn’t want to upload; But hear I am not trying to upload the file
for the user. I am just trying to construct a dynamic file filter to reduce
the number of possible files to be considered. Is there anyway to accomplish
this? If not are there any public domain file uploading controls that are
worth recommending?
Thanks in advance
them in finding the appropriate file. I don’t believe there is an out of the
box way to filter the files that will be listed in the browsers file browser
dialog. I did however notice that if a user types a filter in the textbox
associated with the fileUpload control (ex: ‘*weeklyStatusReport*.xml’) and
then clicks browse, that this is able to filter the displayed files. This
may only work in internet explorer but for my intranet application this could
be useful. The problem I run into is that I would like to fill in the
textbox associated with the fileUpload control for the user and this is
proving more difficult than I had expected.
I have read access to the file in the textbox with javascript:
var uploader= document.getElementById('<%=Me.FileUpload1.ClientID%>');
if (uploader.value =='')
{args.IsValid=false;
uploader.value=’someText’
Doesn’t produce an error but it doesn’t work either.
I know that there is some protection here to keep asp from uploading files
the users doesn’t want to upload; But hear I am not trying to upload the file
for the user. I am just trying to construct a dynamic file filter to reduce
the number of possible files to be considered. Is there anyway to accomplish
this? If not are there any public domain file uploading controls that are
worth recommending?
Thanks in advance