public static bool IsValid( string sFileName )
{
//A blob name must be at least one character long and cannot be more than 1,024 characters long
if ( ( sFileName.Length == 0 ) || sFileName.Length > 1024 )
return false;
//A blob name can contain any combination of characters, except reserved URL characters
//Notice: '/' is a URL reserved char, but in Azure blob can be used for virtual dir
string validSpecialChars = @"$-_.+!*'()/";
foreach ( char c in sFileName )
{
if ( !( char.IsLetterOrDigit( c ) || validSpecialChars.IndexOf( c ) >= 0 ) )
return false;
}
return true;
}