By default, the maximum file size to upload is 4MB. To increase it, simply add this section in web.config:
This will dictate the maximum size to be 5MB.
Archive for February, 2009
Max File Size Upload In ASP.Net
Posted in .Net, ASP.Net, Uncategorized on February 24, 2009 | Leave a Comment »
File MIME Type Using C#
Posted in .Net, C#, Windows on February 23, 2009 | Leave a Comment »
string fileName = “C:\\somefile.vsd”;
string mimeType = “application/unknown”;
string ext = System.IO.Path.GetExtension(fileName).ToLower();
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
if (regKey != null && regKey.GetValue(“Content Type”) != null)
{
mimeType = regKey.GetValue(“Content Type”).ToString();
}