Beispiel #1
0
        public ActionResult Upload()
        {
            string path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);

            try
            {
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    HttpPostedFileBase file = Request.Files[i];
                    if (file.ContentLength > 0)
                    {
                        string completeFileName = file.FileName;
                        string nameSmall        = System.IO.Path.GetFileName(completeFileName);
                        string fullPathAndName  = path + "\\" + nameSmall;
                        DiskStorage.FileManagerCreateFile(MTApp.CurrentStore.Id, fullPathAndName, file);
                    }
                }
            }
            catch (Exception ex)
            {
                FlashFailure(ex.Message);
                MerchantTribe.Commerce.EventLog.LogEvent(ex);
            }

            string destination = Url.Content("~/bvadmin/content/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #2
0
        public ActionResult Upload()
        {
            var path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);

            try
            {
                for (var i = 0; i < Request.Files.Count; i++)
                {
                    var file = Request.Files[i];
                    if (file.ContentLength > 0)
                    {
                        var completeFileName = file.FileName;
                        var nameSmall        = Path.GetFileName(completeFileName);
                        var fullPathAndName  = path + "\\" + nameSmall;
                        DiskStorage.FileManagerCreateFile(HccApp.CurrentStore.Id, fullPathAndName, file);
                    }
                }
            }
            catch (Exception ex)
            {
                FlashFailure(ex.Message);
                EventLog.LogEvent(ex);
            }

            var destination = Url.Content("~/DesktopModules/Hotcakes/API/mvc/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #3
0
        //
        // GET: /AdminContent/FileManager/
        public ActionResult Index()
        {
            string path      = Request.QueryString["path"] ?? string.Empty;
            string cleanPath = DiskStorage.FileManagerCleanPath(path);

            FileManagerViewModel model = new FileManagerViewModel(cleanPath);

            model.Directories    = DiskStorage.FileManagerListDirectories(MTApp.CurrentStore.Id, cleanPath);
            model.Files          = DiskStorage.FileManagerListFiles(MTApp.CurrentStore.Id, cleanPath);
            model.BreadCrumbs    = BuildBreadCrumbs(cleanPath);
            model.BasePreviewUrl = "~/images/sites/" + MTApp.CurrentStore.Id + "/";

            return(View(model));
        }
Beispiel #4
0
        //
        // GET: /AdminContent/FileManager/
        public ActionResult Index()
        {
            var path      = Request.QueryString["path"] ?? string.Empty;
            var cleanPath = DiskStorage.FileManagerCleanPath(path);

            var model = new FileManagerViewModel(cleanPath)
            {
                Directories    = DiskStorage.FileManagerListDirectories(HccApp.CurrentStore.Id, cleanPath),
                Files          = DiskStorage.FileManagerListFiles(HccApp.CurrentStore.Id, cleanPath),
                BreadCrumbs    = BuildBreadCrumbs(cleanPath),
                BasePreviewUrl = DiskStorage.GetStoreDataPhysicalPath(HccApp.CurrentStore.Id)
            };

            return(View(model));
        }
Beispiel #5
0
        //
        // GET: /AdminContent/FileManager/
        public ActionResult Index()
        {
            string path      = Request.QueryString["path"] ?? string.Empty;
            string cleanPath = DiskStorage.FileManagerCleanPath(path);

            FileManagerViewModel model = new FileManagerViewModel(cleanPath);

            model.Directories    = DiskStorage.FileManagerListDirectories(MTApp.CurrentStore.Id, cleanPath);
            model.Files          = DiskStorage.FileManagerListFiles(MTApp.CurrentStore.Id, cleanPath);
            model.BasePreviewUrl = "~/images/sites/" + MTApp.CurrentStore.Id + "/";

            var breadRender = new code.TemplateEngine.TagHandlers.BreadCrumbs();

            ViewBag.BreadCrumbsFinal = breadRender.Render(MTApp, BuildBreadCrumbs(cleanPath));
            return(View(model));
        }
Beispiel #6
0
        public ActionResult DeleteFile()
        {
            var path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            var fileName = Request.Form["filename"] ?? string.Empty;

            fileName = DiskStorage.FileManagerCleanPath(fileName);

            var fullPath = path + "\\" + fileName;

            DiskStorage.FileManagerDeleteFile(HccApp.CurrentStore.Id, fullPath);

            var destination = Url.Content("~/DesktopModules/Hotcakes/API/mvc/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #7
0
        public ActionResult CreateDirectory()
        {
            string path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            string newDirName = Request.Form["newdirectoryname"] ?? string.Empty;

            newDirName = DiskStorage.FileManagerCleanPath(newDirName);

            string fullPath = path + "\\" + newDirName;

            DiskStorage.FileManagerCreateDirectory(MTApp.CurrentStore.Id, fullPath);

            string destination = Url.Content("~/bvadmin/content/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #8
0
        public ActionResult DeleteFile()
        {
            string path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            string fileName = Request.Form["filename"] ?? string.Empty;

            fileName = DiskStorage.FileManagerCleanPath(fileName);

            string fullPath = path + "\\" + fileName;

            DiskStorage.FileManagerDeleteFile(MTApp.CurrentStore.Id, fullPath);

            string destination = Url.Content("~/bvadmin/content/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #9
0
        public ActionResult CreateDirectory()
        {
            var path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            var newDirName = Request.Form["newdirectoryname"] ?? string.Empty;

            newDirName = DiskStorage.FileManagerCleanPath(newDirName);

            var fullPath = path + "\\" + newDirName;

            DiskStorage.FileManagerCreateDirectory(HccApp.CurrentStore.Id, fullPath);

            var destination = Url.Content("~/DesktopModules/Hotcakes/API/mvc/filebrowser?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #10
0
        public ActionResult DeleteDirectory()
        {
            var path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            var deletePath = Request.Form["deletepath"] ?? string.Empty;

            deletePath = DiskStorage.FileManagerCleanPath(deletePath);

            if (!DiskStorage.FileManagerIsSystemPath(deletePath))
            {
                DiskStorage.FileManagerDeleteDirectory(HccApp.CurrentStore.Id, deletePath);
            }

            var destination = Url.Content("~/DesktopModules/Hotcakes/API/mvc/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }
Beispiel #11
0
        public ActionResult DeleteDirectory()
        {
            string path = Request.Form["path"] ?? string.Empty;

            path = DiskStorage.FileManagerCleanPath(path);
            string deletePath = Request.Form["deletepath"] ?? string.Empty;

            deletePath = DiskStorage.FileManagerCleanPath(deletePath);

            if (!DiskStorage.FileManagerIsSystemPath(deletePath))
            {
                DiskStorage.FileManagerDeleteDirectory(MTApp.CurrentStore.Id, deletePath);
            }

            string destination = Url.Content("~/bvadmin/content/filemanager?path=" + path);

            return(new RedirectResult(destination));
        }