if (File.Exists (Server.MapPath ("../ App_Data / Karten /") + FileUpload1.PostedFile.FileName.Replace ("ö", "oe"). Replace ("Ö", " э ") Заменить (." A - ") Заменить ( " ") Заменить ( "»," ае ä"," Ae ü", "УП".) Заменить ( "AOE", "Ue")) ) {
Label1.Text = "Datei existiert bereits";
} Еще {
строка filepath = FileUpload1.PostedFile.FileName;
System.Diagnostics.Debug.WriteLine ("Имя файла" + путь к файлу);
System.Diagnostics.Debug.WriteLine("Filename" + filepath.Replace("ö","oe").Replace("Ö","Oe").Replace("Ö","ae").Replace("ä","Ae").Replace("ü","ue").Replace("Ü","Ue"));
if (FileUpload1.PostedFile.FileName.ToLower().EndsWith("jpeg") || FileUpload1.PostedFile.FileName.ToLower().EndsWith("jpg"))
{
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
if (UploadedImage == null)
{
Label1.Text = "Kein Bild";
System.IO.File.Delete(Server.MapPath("../App_Data/Karten/") + filepath);
}