Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ArgumentOutOfRangeException
Message
De
08/03/2010 10:53:25
 
 
À
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:
01453177
Vues:
32
>>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.


Been reading the docs - Haven't found anything the control the file name/extension

They say (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx)
use HasFile to test whether it contains a filename


Before calling the SaveAs method to save the file to the server, use the HasFile property to verify that the FileUpload control contains a file. If the HasFile returns true, call the SaveAs method. If it returns false, display a message to the user indicating that the control does not contain a file. Do not check the PostedFile property to determine whether a file to upload exists because, by default, this property contains 0 bytes. As a result, even when the FileUpload control is blank, the PostedFile property returns a non-null value.
 string filepath = this.uplLogo.PostedFile.FileName;
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform