>>>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
Thanks, where does the GetExtension() come from?
< later > I found a reference to Path.GetExtension, so I guess this is what you were meaning.