Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if (fuPhoto.PostedFile != null && fuPhoto.PostedFile.FileName != string.Empty) //Checking for valid file
{
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(fuPhoto.PostedFile.InputStream);
float UploadedImageWidth = UploadedImage.PhysicalDimension.Width;
float UploadedImageHeight = UploadedImage.PhysicalDimension.Height;
float NewImageWidth = UploadedImageWidth;
float NewImageHeight = UploadedImageHeight;
bool bResize = false;
// Since the PostedFile.FileNameFileName gives the entire path we use Substring function to rip of the filename alone.
string StrFileName = fuPhoto.PostedFile.FileName.Substring(fuPhoto.PostedFile.FileName.LastIndexOf("\\") + 1);
string StrFileType = fuPhoto.PostedFile.ContentType;
int IntFileSize = fuPhoto.PostedFile.ContentLength;
//Checking for the length of the file. If length is 0 then file is not uploaded.
if (IntFileSize <= 0)
{
//lblMessage.Text=" <font color='Red' size='2'>Uploading of file " + StrFileName + " failed </font>";
}
else
{
string strCompleteFilePath = Server.MapPath(".\\images\\uploaded\\" + "UserID" + iUserID + StrFileName);
fuPhoto.PostedFile.SaveAs(strCompleteFilePath);
}