|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Filtering the Asp:FileUpload controlthem 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 Hi Jeff,
Thanks for your post! This is by the design. Setting this <input type=file> html element programmatically is considered a security risk and is not supported. For more information, please refer to the link below: "PRB: Cannot Use Script to Manipulate INPUT TYPE=File Value" http://support.microsoft.com/kb/266087/en-us Hope this helps! Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
pop-up browser persist data back to parent page code-behind
How do change layout od SideBar in Wizard control? (ASP.NET 2.0) FileUpload - keep the filename ObjectDataSource, GridView and ItemTemplate NullReferenceException With Different Register Directive Navigation Menu Site Map Difficulties WebPart and WebPartZones Usage Access property and control of master page from a customized parent page class CustomControl and body.onload Asp.Net 2.0 Bug |
|||||||||||||||||||||||