Beispiel #1
0
        public Stream getImage(Int32 userId)
        {
            object theImg = null;

            DaImage daImage = new DaImage();
            DataTable dtImage = daImage.GetImage(userId);

            theImg = dtImage.Rows[0]["picture"];

            return new MemoryStream((byte[])theImg);
        }
Beispiel #2
0
        void ButtonUpload_Click(object sender, EventArgs e)
        {
            if (FileUpload.HasFile)
            {
                int imageFileLen = FileUpload.PostedFile.ContentLength;
                byte[] imageArray = new byte[imageFileLen];
                HttpPostedFile image = FileUpload.PostedFile;
                image.InputStream.Read(imageArray, 0, imageFileLen);
                //MemoryStream stream = new MemoryStream(imageArray);

                Int32 userId = 2;

                DaImage daImage = new DaImage();
                daImage.SaveImage(userId, imageArray);

            }
        }