Re: A few questions..

  •  01-23-2012, 9:24 AM

    Re: A few questions..

    Ok, nvm..  The reason it wasn't working was because of the..
    System.Drawing.Image postedImage = System.Drawing.Image.FromStream(args.OpenStream());   
    I have changed the method to that below and everything seems to be working much better. I'm going to test this out with large files (120meg) and if it works.. $$ is on the way.
     
    1. protected void Uploader1_FileUploaded(object sender, CuteWebUI.UploaderEventArgs args)  
    2.    {  
    3.        string UploadedImageDir = Server.MapPath("UploadedImages/");  
    4.   
    5.        string OrigFilename = args.FileName;  
    6.        string OrigExtention = OrigFilename.Substring(OrigFilename.Length - 4, 4);  
    7.   
    8.        System.Guid newGUID = System.Guid.NewGuid();  
    9.   
    10.   
    11.        string GUIDFilename = newGUID.ToString() + OrigExtention;  
    12.        string PathAndFileToUploadedImagesDir = UploadedImageDir + GUIDFilename;  
    13.   
    14.        args.MoveTo(UploadedImageDir + GUIDFilename);  
    15.   
    16.        System.Drawing.Image postedImage = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(UploadedImageDir + GUIDFilename);  
    17.   
    18.        Session["ImageHeight"] = postedImage.Height.ToString();  
    19.        Session["ImageWidth"] = postedImage.Width.ToString();  
    20.    }  
     
View Complete Thread