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(); }
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; } }
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); }
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(); } }
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); } }
/// <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; } }
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); } }
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); } }
protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e) { Session["SeriesDefaultImage"] = e.UploadedFile.FileBytes; }
protected void upFoto_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e) { string ll = coIDUsuario.Value; SalvarImagem((e.UploadedFile)); }
protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e) { e.CallbackData = e.UploadedFile.FileName; }
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; }
protected void upload_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e) { //Save File Here }