protected void afuDocuments_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { //Save the file to specified location. String strFilePath = Request.PhysicalApplicationPath + "Documents\\" + e.FileName; afuDocuments.SaveAs(strFilePath); }
protected void UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { try { Account account = new Account("dlyvxs7of", "634626974285569", "FtB_0jhcmFypFS7QTwCBKcPRGzE"); Cloudinary cloudinary = new Cloudinary(account); ImageUploadParams uploadParams = new ImageUploadParams() { File = new FileDescription("file", new MemoryStream(e.GetContents())) }; ImageUploadResult uploadResult = cloudinary.Upload(uploadParams); HEWDataContext context = new HEWDataContext(); context.ProjectsImages.InsertOnSubmit(new ProjectsImage { ImgPublicID = uploadResult.PublicId, ProjectID = int.Parse(Request.QueryString["ProjectID"]) }); context.SubmitChanges(); } catch (Exception) { } }
protected void UploadForm_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { var result = new Dictionary <string, string>(); using (ZipFile zip = ZipFile.Read(e.GetStreamContents())) { foreach (ZipEntry entry in zip) { MemoryStream data = new MemoryStream(); entry.Extract(data); var resString = Encoding.UTF8.GetString(data.ToArray()); result.Add(entry.FileName, resString); } } foreach (var file in result) { var fileArr = file.Key.Split('.').ToList(); var fileExtesion = fileArr.Last(); fileArr.RemoveAt(fileArr.Count - 1); var fileName = string.Join("", fileArr); var txtFile = new AspNetFileUpload.File() { FileName = fileName, FileExtension = fileExtesion, FileContent = file.Value }; this.db.Files.Add(txtFile); } this.db.SaveChanges(); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } if (e.State != AjaxControlToolkit.AjaxFileUploadState.Success) { return; } string szKey = FileObjectSessionKey(e.FileId); PendingIDs.Add(szKey); Session[szKey] = new MFBPendingImage(new MFBPostedFile(e), szKey); e.DeleteTemporaryData(); RefreshPreviewList(); if (Mode == UploadMode.Legacy) { Mode = UploadMode.Ajax; } UploadComplete?.Invoke(this, e); }
protected void AjaxUploadAttech_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { FileInfo fi = new FileInfo(e.FileName); string ext = fi.Extension; string[] data = HttpUtility.UrlDecode(Request.Cookies["asp_act"].Value.ToString()).Split('|'); if (data[1] == "2") { string fileID = Fn.ExenID("INSERT INTO tblEmpDocs (UploadedFor,EmpID,FileTitle, FileExt) VALUES ('EmpPensionDoc'," + data[0] + ", '" + fi.Name + "', '" + ext + "');select SCOPE_IDENTITY()"); string filePath = Server.MapPath("~") + "/Uploads/EmpDocuments/" + fileID + ext; AjaxUploadAttech.SaveAs(filePath); } else { Fn.Exec(@"UPDATE tblEmployee SET PhotoExtension='" + ext + "' WHERE EmpID=" + data[0]); string filePath = Server.MapPath("~") + "/Uploads/EmployeePhoto/" + data[0] + ext; AjaxUploadAttech.SaveAs(filePath); if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 32, 32); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/EmployeePhoto/", Convert.ToString(data[0]) + "A" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 75, 75); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/EmployeePhoto/", Convert.ToString(data[0]) + "B" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } } }
/** * Name: protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) * Description: This function allows the image uploader to succesfully save to the Images folder. * Arguments: sender: Not used. * e: Gets the filename of the selected image. * Return: Nothing is returned. * Author: David Stoddard * Date: 16/04/2015 **/ protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filename = e.FileName; string strDestPath = Server.MapPath(strImagesPath); AjaxFileUpload1.SaveAs(@strDestPath + filename); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { Stream fs = e.GetStreamContents(); BinaryReader br = new BinaryReader(fs); Byte[] bytes = br.ReadBytes((Int32)fs.Length); (this.Session["file2"] as ArrayList).Add(bytes); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // Generate file path string filePath = AppDomain.CurrentDomain.BaseDirectory.ToString() + "/img/galeria/" + System.IO.Path.GetFileName(e.FileName); // Save upload file to the file system AjaxFileUpload1.SaveAs(filePath); }
protected void AjaxFileUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // Generate file path saveAsfilePath = selectedfilePath + e.FileName; // Save upload file to the file system AjaxFileUpload1.SaveAs(MapPath(saveAsfilePath)); }
protected void AjaxFileUpload_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string fileName = "dateweek" + DateTime.Now.ToString("yyyMMddHHss") + new Random().Next(999) + e.ContentType;// +e.FileName; string fullPath = Server.MapPath(ConfigurationManager.AppSettings["PH_FolderUpload"] + fileName); AjaxFileUpload.SaveAs(fullPath); Session["fileName"] = fullPath; }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string fname = DateTime.Now.ToString("yyyMMddHHmmss") + "." + e.FileName.Split('.')[1]; Fn.Exec("INSERT INTO TblVoucherDoc(VoucherID, DocName, DocPath, DocExt)VALUES (" + Request.Cookies["VID"].Value + ", '" + e.FileName.Split('.')[0] + "', '" + fname + "', '" + e.FileName.Split('.')[1] + "')"); string filePath = Server.MapPath("~") + "/Vouchers/" + fname; AjaxFileUpload1.SaveAs(filePath); }
protected void AjaxUploadAttech_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { FileInfo fi = new FileInfo(e.FileName); string ext = fi.Extension; string[] data = HttpUtility.UrlDecode(Request.Cookies["IDforDocument"].Value.ToString()).Split('|'); string CandiDateID = "0"; string tblCandidate_tblJobRequirementID = "0"; using (DBDataContext db = new DBDataContext()) { var c = db.tblCandidates.Where(v => v.CNIC == data[3].Split('½')[0]).FirstOrDefault(); if (c != null) { CandiDateID = Convert.ToString(c.tblCandidateID); } else { CandiDateID = Fn.ExenID(@"INSERT INTO tblCandidate (CNIC, Name, dtDOB, Gender, Religion, FatherName, City, District, CurrentAddress, PermanentAddress, Phone, Mobile, Domicile,Qualification , Experience,JobDescriptions) VALUES ('" + HttpUtility.UrlDecode(data[3]).Split('½')[0] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[1] + @"',CONVERT(DATETIME,'" + HttpUtility.UrlDecode(data[3]).Split('½')[2] + @"',103),'" + HttpUtility.UrlDecode(data[3]).Split('½')[3] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[4] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[5] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[6] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[7] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[8] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[9] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[10] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[11] + @"','" + HttpUtility.UrlDecode(data[3]).Split('½')[12] + @"','" + WebUtility.HtmlEncode(HttpUtility.UrlDecode(data[3]).Split('½')[13]) + @"','" + WebUtility.HtmlEncode(HttpUtility.UrlDecode(data[3]).Split('½')[14]) + @"','" + WebUtility.HtmlEncode(HttpUtility.UrlDecode(data[3]).Split('½')[15]) + @"'); select SCOPE_IDENTITY()"); } var cj = db.tblCandidate_tblJobRequirements.Where(v => v.tblCandidateID == Convert.ToDecimal(CandiDateID) && v.tblJobRequirementID == Convert.ToDecimal(data[0])).FirstOrDefault(); if (cj != null) { tblCandidate_tblJobRequirementID = Convert.ToString(cj.tblCandidate_tblJobRequirementID); } else { tblCandidate_tblJobRequirementID = Fn.ExenID(@"INSERT INTO tblCandidate_tblJobRequirement (tblCandidateID, tblJobRequirementID) VALUES ('" + CandiDateID + @"','" + data[0] + @"'); select SCOPE_IDENTITY()"); } } string fileID = Fn.ExenID("INSERT INTO tblDocuments (FileTitle, FileExt, tblName, tblID, EnterByEmpID) VALUES ('" + fi.Name + "','" + ext + "', 'tblCandidate_tblJobRequirement', '" + tblCandidate_tblJobRequirementID + "','" + Convert.ToString(0) + "'); select SCOPE_IDENTITY()"); string filePath = Server.MapPath("~") + "/Uploads/AllDocuments/" + fileID + ext; AjaxUploadAttech.SaveAs(filePath); if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 32, 32); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/AllDocuments/", fileID + "A" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 75, 75); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/AllDocuments/", fileID + "B" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } }
protected void HTMLEditorExtender_HomePage_ImageUploadComplete(object sender , AjaxControlToolkit.AjaxFileUploadEventArgs e) { string fullpath = Server.MapPath("~/images/") + e.FileName; HtmlEditorExtender_HomePage.AjaxFileUpload.SaveAs(fullpath); e.PostedUrl = Page.ResolveUrl("~/images/" + e.FileName); }
protected void aFile_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (Session[CConstantes.ConstantesSesion.VEHICULO] != null) { TBL_VEHICULO item = (TBL_VEHICULO)Session[CConstantes.ConstantesSesion.VEHICULO]; aFile.SaveAs(Server.MapPath("~/Archivos/Vehiculos") + @"\" + item.VEH_PLACA + ".png"); cargarGrid(item.USU_CODIGO); } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (e.FileSize > 10) { string filePath = e.FileName; AjaxFileUpload1.SaveAs(Server.MapPath(filePath)); } else { } }
protected void afuExcel_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string ext = e.ContentType; if (ext == ".xls" || ext == ".xlsx") { string rutaServer = Server.MapPath("Archivos/"); afuExcel.SaveAs(rutaServer + e.FileName); Session["archivo"] = rutaServer + e.FileName; } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string TenAnh = e.FileName; String[] strTmp = TenAnh.Split('.'); TenAnh = DateTime.Now.ToFileTimeUtc().ToString(); TenAnh += "." + strTmp[1]; string strDestPath = Server.MapPath("~/imagesTmp/"); AjaxFileUpload1.SaveAs(@strDestPath + TenAnh); anh = "imagesTmp/" + TenAnh; }
protected void htmlEditorExtender1_ImageUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // if (e.ContentType.Contains("jpg") || e.ContentType.Contains("gif") //|| e.ContentType.Contains("png") || e.ContentType.Contains("jpeg")) // { // Session["fileContentType_" + e.FileId] = e.ContentType; // Session["fileContents_" + e.FileId] = e.GetContents(); // } // // Set PostedUrl to preview the uploaded file. // e.PostedUrl = string.Format("?preview=1&fileId={0}", e.FileId); }
protected void AjaxFileUploadDocument_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = @"C:\Users\Insight\Desktop\New folder\" + e.FileName; AjaxFileUploadDocument.SaveAs(filePath); //string fullFileName = ""; //fullFileName = Path.Combine(ConfigurationManager.AppSettings["documentFolderUpload"].ToString(), e.FileName); //AjaxFileUploadDocument.SaveAs(fullFileName); //ProcessFile(Path.Combine(ConfigurationManager.AppSettings["documentFolderUpload"].ToString(), e.FileName), ".xls"); }
protected void UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { try { string path = Server.MapPath("../../../Content/imgSub/") + e.FileName.ToString(); Session["nombrefoto"] = e.FileName.ToString(); AjaxFileUpload1.SaveAs(path); } catch { Session["nombrefoto"] = ""; Mensaje("publicacion de la foto", false); btnCargar.Enabled = false; } }
public MFBPostedFile(AjaxControlToolkit.AjaxFileUploadEventArgs e) : this() { if (e == null) { throw new ArgumentNullException(nameof(e)); } using (Stream s = e.GetStreamContents()) WriteStreamToTempFile(s); FileID = e.FileId; FileName = e.FileName; ContentType = e.ContentType; ContentLength = e.FileSize; }
protected void AjaxFileUpload_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { try { string fileName = "bh_" + DateTime.Now.ToString("yyyMMddHHss") + new Random().Next(999) + e.ContentType;// +e.FileName; string fullPath = Server.MapPath(ConfigurationManager.AppSettings["PH_FolderUpload"] + fileName); AjaxFileUpload.SaveAs(fullPath); Session["fileName"] = fullPath; btnSubmit.Enabled = true; } catch (Exception ex) { lblErr.Text = ex.Message; PH_ExceptionManager.WriteError("AjaxFileUpload_UploadComplete >>" + ex.Message); } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { try { string savePath = MapPath("~/Images/" + e.FileName); // dont save file & return if condition not matched. if (e.FileSize > 72000) // use same condition in client side code { return; } AjaxFileUpload1.SaveAs(savePath); } catch (Exception ex) { throw ex; } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string guid = Guid.NewGuid().ToString(); UploadSession obj = (UploadSession)Session["upload"]; string filename = Server.MapPath("/Albums/" + obj.Folder + "/" + guid + ".JPG"); AjaxFileUpload1.SaveAs(filename); SqlParameter pID = new SqlParameter("AlbumID", SqlDbType.Int); pID.Value = obj.Id; SqlParameter pUrl = new SqlParameter("ImageUrl", SqlDbType.NVarChar); pUrl.Value = guid + ".jpg"; SqlParameter insertedKey = new SqlParameter("AlbumDetailID", SqlDbType.Int); insertedKey.Direction = ParameterDirection.Output; string NewsID = DataAccessLayer.ExcuteNoneQueryHasOutput("Album_InsertAlbumDetail", "AlbumDetailID", pID, pUrl, insertedKey); }
protected void fuVideo_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string dir = ConfigurationManager.AppSettings["NewsVideoPath"] + @"\" + Helper.GetDirectory(); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } string fileName = Helper.ToEnglishWord(e.FileName); string filePath = dir + Helper.GetDirectoryForInline() + fileName; fuVideo.SaveAs(filePath); //int videoId = VideoOprt.Insert(txtMansetBaslik.Text, txtOzet.Text, Helper.GetUrl(txtMansetBaslik.Text), // filePath, txtEtiketler.Text, 1212); //Session["VideoId"] = videoId; }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } if (e.State != AjaxControlToolkit.AjaxFileUploadState.Success) { lblFileRequired.Text = Resources.LogbookEntry.errImportInvalidCSVFile; SetWizardStep(wsUpload); return; } Session[szSessFile] = e.GetContents(); e.DeleteTemporaryData(); // Now we wait for the force refresh }
protected void fuResim_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string dir = ConfigurationManager.AppSettings["NewsImagePath"] + @"\" + Helper.GetDirectory(); string rnd = Helper.GetDirectoryForInline(); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } byte[] imageByteArray = e.GetContents(); MemoryStream stream = new MemoryStream(); stream.Write(imageByteArray, 0, imageByteArray.Length); Bitmap imageBitMap = new Bitmap(stream); System.Drawing.Image yeniImg = System.Drawing.Image.FromStream(stream); int height = (yeniImg.Height * 640) / yeniImg.Width; UploadImage uploadHabericiResim = new UploadImage(); uploadHabericiResim.SaveImageSingle(imageBitMap, dir, rnd + e.FileName, 640, height); }
protected void saveImage(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string tempPath = System.IO.Path.GetTempPath(); System.Drawing.Image img = new GUIHelper().byteArrayToImage(e.GetContents()); if (Session["fileContentType_"] == null) { Session.Add(("fileContentType_"), e.ContentType); } Session["fileContentType_"] = e.ContentType; if (Session["fileContents_"] == null) { Session.Add("fileContents_", e.GetContents()); } Session["fileContents_"] = e.GetContents(); string relativePath = Page.AppRelativeVirtualPath; relativePath = relativePath.Replace("~", ""); e.PostedUrl = String.Format("/HRM" + relativePath + "?preview=1"); }
protected void AjaxUploadAttech_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { FileInfo fi = new FileInfo(e.FileName); string ext = fi.Extension; string[] data = HttpUtility.UrlDecode(Request.Cookies["IDforDocument"].Value.ToString()).Split('|'); string fileID = Fn.ExenID("INSERT INTO tblDocuments (FileTitle, FileExt, tblName, tblID, EnterByEmpID) VALUES ('" + fi.Name + "','" + ext + "', 'tblJobRequirement', '" + data[0] + "','" + Convert.ToString(Convert.ToString(((HttpCookie)HttpContext.Current.Request.Cookies["Emp_Id"]).Value)) + "'); select SCOPE_IDENTITY()"); string filePath = Server.MapPath("~") + "/Uploads/AllDocuments/" + fileID + ext; AjaxUploadAttech.SaveAs(filePath); if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 32, 32); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/AllDocuments/", fileID + "A" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } if (fi.Extension.ToUpper() == ".JPEG" || fi.Extension.ToUpper() == ".JPG" || fi.Extension.ToUpper() == ".BMP" || fi.Extension.ToUpper() == ".PNG" || fi.Extension.ToUpper() == ".GIF") { Bitmap Thumbnail = CreateThumbnail(filePath, 75, 75); string SaveAsThumbnail = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~") + "/Uploads/AllDocuments/", fileID + "B" + fi.Extension); Thumbnail.Save(SaveAsThumbnail); } }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string fileNameWithPath = Server.MapPath("~/Images/") + e.FileName.ToString(); AjaxFileUpload1.SaveAs(fileNameWithPath); }