I used following code to get uploaded image dimensions .
Where flLogoUplaoded is name of asp .net file uploaded control at my application
string UploadedImageType = flLogoUpload.PostedFile.ContentType.ToString().ToLower();
string UploadedImageFileName = flLogoUpload.PostedFile.FileName;
//Create an image object from the uploaded file
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(flLogoUpload.PostedFile.InputStream);
//Determine width and height of uploaded image
float UploadedImageWidth = UploadedImage.PhysicalDimension.Width;
float UploadedImageHeight = UploadedImage.PhysicalDimension.Height;
Response.Write( UploadedImageWidth + “
”);
Response.Write(UploadedImageHeight + “
”);
No comments:
Post a Comment