public ViewingServiceCreator() { IRootPathFinder rootPathFinder = new RootPathFinder(); _rootStoragePath = rootPathFinder.GetRootStoragePath(); _downloadPath = Path.Combine(_rootStoragePath ?? String.Empty, Constants.DownloadDirectory, Constants.FromRemoteStorageDirectory); _helper = new Helper(); }
public ActionResult Index(HttpPostedFileBase file) { string fileName = ""; try { if (file != null && file.ContentLength > 0) { //Get the file name of the file to be Uploaded String FileExtension = Path.GetExtension(file.FileName); //Get the file extension of the file to be uploaded fileName = Path.GetFileName(file.FileName); //Get the RootStoragePath value using RootPathFinder class of namespace Groupdocs.Web.UI. The RootStoragePath is set in the Global.asax RootPathFinder rpf = new RootPathFinder(); string rootDirectory = rpf.GetRootStoragePath(); var FilePath = rootDirectory + fileName; //Save the file file.SaveAs(FilePath); } } catch (Exception ex) { throw ex; } //Pass the FileName to View for display in the Div ViewBag.FileName = fileName; return View(); }