The following makes sure a valid picture file was uploaded.
this.ctlUpload.HasFile == true;
this.ctlUpload.PostedFile.ContentType == "image/bmp";
this.ctlUpload.PostedFile.ContentType == "image/pjpeg";
this.ctlUpload.PostedFile.ContentType == "image/gif";
this.ctlUpload.PostedFile.ContentType == "image/x-png";
The uploaded picture can then be accessed with :
HttpPostedFile postedFile = this.ctlUpload.PostedFile;
Bitmap picture = new Bitmap(postedFile.InputStream);
Monday, July 21, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment