Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ArgumentOutOfRangeException
Message
De
08/03/2010 11:55:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
08/03/2010 10:35:58
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01453133
Message ID:
01453199
Vues:
25
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform