public void Submit() { if (thumbnails != null && thumbnails != "") { int htmlNameImgIdex = thumbnails.LastIndexOf('\\'); string NewName = ""; if (htmlNameImgIdex > 0) { string Img = thumbnails.Substring(htmlNameImgIdex + 1); int indexd = Img.LastIndexOf('.'); string Expender = Img.Substring(indexd); NewName = Guid.NewGuid().ToString(); string ImgName = NewName + "_s" + Expender; string assetpath = Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + ImgName; FileSecurity.StreamToFileInfo(assetpath, thumbnails); thumbnails = assetpath; } int htmlNameIdex = path.LastIndexOf('\\'); if (htmlNameIdex > 0) { string pathTmp = path.Substring(htmlNameIdex + 1); int indexd = pathTmp.LastIndexOf('.'); string Expender = pathTmp.Substring(indexd); string AssName = ""; if (NewName != "") { AssName = NewName + Expender; } else { NewName = Guid.NewGuid().ToString(); AssName = NewName + Expender; } string assetpath = Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + AssName; FileSecurity.StreamToFileInfo(assetpath, path); path = assetpath; } _AssInfo.AssetPath = path; _AssInfo.AssetName = NewName; _AssInfo.Thumbnails = thumbnails; } }