Beispiel #1
0
        protected void AfuFile_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
        {
            try
            {
                Guid id = FileDUHelper.UploadAttach(this.AfuFile);

                Session[this.SessionKey] = id;

                this.OnUploadedCompleted(e);
            }
            catch (ApplicationException aex)
            {
                throw aex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Guid?id = UrlHelper.GetQueryStringGUID("id");

                Attachment attach = null;
                if (id.HasValue)
                {
                    attach = new AttachmentBl().GetAttachmentByID(id.Value);
                }

                if (attach == null)
                {
                    return;
                }

                FileDUHelper.Download(attach.Title, System.Configuration.ConfigurationManager.AppSettings["File"] + attach.Path);
            }
        }