1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| switch (Extension)
{
case "gif":
pid.Attributes.Add("type", "image/gif");
break;
case "tiff":
pid.Attributes.Add("type", "image/tiff");
break;
case "png":
pid.Attributes.Add("type", "image/png");
break;
case "bmp":
pid.Attributes.Add("type", "image/bmp");
break;
case "jpg":
pid.Attributes.Add("type", "image/jpeg");
break;
case "avi":
pid.Attributes.Add("controls", "controls");
pid.Attributes.Add("preload", "auto");
pid.Attributes.Add("autoplay", "autoplay");
pid.Attributes.Add("typeof", "video/msvideo");
break;
case "mp4":
pid.Attributes.Add("controls", "controls");
pid.Attributes.Add("preload", "auto");
pid.Attributes.Add("autoplay", "autoplay");
pid.Attributes.Add("typeof", "video/mp4");
break;
case "ppt":
pid.Attributes.Add("type", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
break;
case "pptx":
pid.Attributes.Add("type", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
break;
case "pdf":
pid.Attributes.Add("type", "application/pdf");
break;
} |