예제 #1
0
        protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
        {
            string filePath = Server.MapPath(sFolder + e.UploadedFile.FileName);

            e.UploadedFile.SaveAs(filePath);
            e.CallbackData = "/Download.aspx?file=" + e.UploadedFile.FileName;
            LoadData();
        }
예제 #2
0
        protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
        {
            string filePath = Server.MapPath("~/App_Data/" + e.UploadedFile.FileName);

            e.UploadedFile.SaveAs(filePath);
            e.CallbackData = "/Download.aspx?file=" + e.UploadedFile.FileName;
            HD_File.Value  = "/Download.aspx?file=" + e.UploadedFile.FileName;
            //e.UploadedFile.FileBytes.Length;
        }
 protected void uplImage_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs args)
 {
     try {
         args.CallbackData = SaveUploadFile();
     } catch (Exception e) {
         args.IsValid   = false;
         args.ErrorText = e.Message;
     }
 }
예제 #4
0
    protected void ucLogoEmpresa_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
    {
        //string name = e.UploadedFile.FileName;
        //string url = ucLogoEmpresa.SpriteImageUrl;
        //long sizeInKilobytes = e.UploadedFile.ContentLength / 1024;
        //string sizeText = sizeInKilobytes.ToString() + " KB";
        //e.CallbackData = name + "|" + url + "|" + sizeText;


        cad.ImgEmpresa(36, e.UploadedFile.FileBytes);
    }
예제 #5
0
        protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
        {
            string filePath = Server.MapPath(sFolder + e.UploadedFile.FileName);
            string sf       = e.UploadedFile.FileName.ToUpper();

            if (sf.EndsWith(".JPG") || sf.EndsWith(".PNG") || sf.EndsWith(".GIF"))
            {
                e.UploadedFile.SaveAs(filePath);
                e.CallbackData = "/Download.aspx?file=" + e.UploadedFile.FileName;
                LoadData();
            }
        }
예제 #6
0
 protected void fileUpload_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     if (fileUpload.UploadedFiles.Count() > 0)
     {
         string sSavePath       = "~/Pictures/Profiles/";
         string resultExtension = Path.GetExtension(e.UploadedFile.FileName);
         string resultFileName  = Path.ChangeExtension(MethodExtension.GetMd5Hash(CurrentUser.salt.ToString() + CurrentUser.ID), resultExtension);
         string resultFileUrl   = sSavePath + resultFileName;
         string resultFilePath  = MapPath(resultFileUrl);
         e.UploadedFile.SaveAs(resultFilePath);
     }
 }
예제 #7
0
 /// <summary>
 /// save each file to correct path as it is uploaded
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void dxuploadpodfiles_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     if (e.IsValid)
     {
         string _uid = wwi_security.DecryptString(this.dxhfmanager.Get("uid").ToString(), "publiship");
         //save to temporary folder then copy after all files have been uploaded during dxcbpodfiles_Callback
         string _filename = e.UploadedFile.FileName;
         string _tempdir  = DateTime.Now.ToShortDateString().Replace("/", "") + _uid;
         string _filepath = System.IO.Path.Combine("~\\documents\\not found", _tempdir);
         if (folder_create(_filepath) == true)
         {
             e.UploadedFile.SaveAs(Server.MapPath(System.IO.Path.Combine(_filepath, _filename)));
         }
     }
     else
     {
         this.dxlblerr.Text    = "File upload failed";
         this.dxpnlerr.Visible = true;
     }
 }
예제 #8
0
    protected void uc_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
    {
        //It is not allowed to post messages in the online mode. Download this example on your machine and remove this restriction
        bool isOnlineMode = true;

        if (!isOnlineMode)
        {
            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(FromTB.Text.Trim());
            mail.To.Add(new MailAddress(SendToTB.Text.Trim()));
            mail.Body = MailBody.Html;
            mail.Attachments.Add(new Attachment(e.UploadedFile.FileContent, e.UploadedFile.FileName));

            SmtpClient smtp = new SmtpClient(HOST_ADDRESS, HOST_PORT);
            smtp.EnableSsl             = true;
            smtp.UseDefaultCredentials = false;
            smtp.Credentials           = new NetworkCredential(HOST_USERNAME, HOST_PASSWORD);
            smtp.Send(mail);
        }
    }
예제 #9
0
        protected void UploadControl_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
        {
            try
            {
                string contentType = HttpContext.Current.Request.Files[0].ContentType;
                Logger.Log(string.Format("Tryed content type is {0} ({1})", contentType, e.UploadedFile.FileName), LogLevel.Info);
                if (Path.GetExtension(e.UploadedFile.FileName) != ".xls")
                {
                    e.IsValid            = false;
                    lblImportStatus.Text = e.ErrorText = "Typ dokumentu není povolen pro nahrávání";
                    return;
                }

                string filename = FileUtils.SavePostedFile(e.UploadedFile);
                // import uploaded file
                CanonResellersImport <CanonImportResellerRecord> import = new CanonResellersImport <CanonImportResellerRecord>(filename, e.UploadedFile.FileName);
                if (!import.ExportToDb())
                {
                    e.IsValid            = false;
                    lblImportStatus.Text = e.ErrorText = Utilities.GetResourceString("Validators", "GeneralFileImportError");
                }
                else
                {
                    e.IsValid            = true;
                    lblImportStatus.Text = e.ErrorText = Utilities.GetResourceString("Validators", "FileImportedSuccessfully");
                }

                e.CallbackData = Utilities.BuildStringWithSeparator(
                    Utilities.ConvertImportErrorsToStrings(import.ErrorMessages), "||");
            }
            catch (Exception ex)
            {
                e.IsValid            = false;
                lblImportStatus.Text = e.ErrorText = Utilities.GetResourceString("Validators", "GeneralFileImportError");

                Logger.Log(string.Format("File {0}, exception {1}", e.UploadedFile.FileName, ex.ToString()),
                           LogLevel.Error);
            }
        }
예제 #10
0
 protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     Session["SeriesDefaultImage"] = e.UploadedFile.FileBytes;
 }
예제 #11
0
    protected void upFoto_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
    {
        string ll = coIDUsuario.Value;

        SalvarImagem((e.UploadedFile));
    }
예제 #12
0
 protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     e.CallbackData = e.UploadedFile.FileName;
 }
예제 #13
0
 protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     // Your code here
 }
 protected void ucCompanyLogo_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     file = e.UploadedFile.FileBytes;
 }
예제 #15
0
 protected void upload_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
 {
     //Save File Here
 }