View Single Post
  #1 (permalink)  
Old October 30th, 2006, 06:42 AM
daffodils daffodils is offline
Registered User
 
Join Date: Oct 2006
Location: kolkata, WB, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to daffodils
Default Queries On File Field Html Control in ASP.NET 1.1

Hi frenz,
I'm using a File field control to browse and get the path of a file. I can also validate for the type of file I want to browse. Like I'm using the regular expression validator as

'----this is the file field control-----
<INPUT id="fn" type="file" name="fn" runat="server">
'-----this is the validator for fn-----
<asp:RegularExpressionValidator
id="REVV" runat="server"
ErrorMessage="Hello not a pic"
ControlToValidate="fn"
ValidationExpression="^(([a-zA-Z]:
)|(\\{2}\w+)\$?)(\\(\w[\w].*))+
(.bmp|.jpeg|.png|.gif|.avi)">
</asp:RegularExpressionValidator>

but what I want is that :-

1> to open a particular folder exsisting in my website (http:\\localhost\\website ) in the website folder in wwwroot whenever the browse button is clicked

2> to get the functionality of the OpenFileDialogue control in VB.net of displaying only the file types specified by the filter property
eg.
OFD.Filter = "Text Files (*.txt; *.doc)|*.txt; *.doc|" + "Image files (*.bmp; *.gif; *.jpg; *.png)|*.bmp;*.gif;*.jpg;*.png|" + _
"All files (*.*)|*.*"


a.shows only .txt & .doc files when "Text Files" is selected in the File Type field
b.shows only .bmp, .gif, .jpg & .png files when "Image Files" is selected in the File Type field
c.shows all files when "All files" is selected

Can we do these things with the file field control in asp.net 1.1?


There's no defeat untill you stop trying....