Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ArgumentOutOfRangeException
Message
From
08/03/2010 11:55:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
08/03/2010 10:35:58
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01453133
Message ID:
01453199
Views:
24
>>Getting rid of the Regex ? You throw away all the fun ...
>
>:)
>
>But if I understand correctly, the RegEx could was to get just the filename and extension and it was not necessary since the filename and extension were all that were in the property values anyhow. Is that right?
>
>Just to fine tune this properly, is there any way to limit the list of files displayed in the dialog to just image files? I saw reference to a .Access property that was used for this purpose, but my control does not have anything similar on it.

With the FileUpload control you can get the extension and just reject it.


if (uploader.HasFile)
{
string fileName = Server.HtmlEncode(uploader.FileName);
string ext = GetExtension(fileName);
if(ext == ".jpg" || ext == ".gif")
// Call your save
else
// Tell the user they need to select a jpg or gif file.
}
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform