Exemple #1
0
    protected void Upload(object sender, EventArgs e)
    {
        string filename = UniqueFilename(UploadedImageFile.FileName);

        UploadedImageFile.SaveAs(FileLinkFolder + filename);

        BindImageList();
        ImageList.SelectedValue = filename;
        SelectImage(null, null);
    }
Exemple #2
0
    protected void Upload(object sender, EventArgs e)
    {
        if (FileHelpers.CheckImageExtension(UploadedImageFile.FileName))
        {
            string filename = UniqueFilename(UploadedImageFile.FileName);
            UploadedImageFile.SaveAs(FileImageFolder + filename);

            byte[]     data = ImageMedia.Create(UploadedImageFile.FileBytes).ToByteArray();
            FileStream file = File.Create(FileImageFolder + filename);
            file.Write(data, 0, data.Length);
            file.Close();

            BindImageList();
            ImageList.SelectedValue = filename;
            SelectImage(null, null);
        }
    }