c# - Roxy file manager in MVC doesn't accept session path -
Hi friends I've downloaded a file manager for my MVC project. So I added to my project and everything works fine but everyone can use this product I mean everyone can type urls and upload files to my host !!!! This filemanager has a Jason config file, as you can see here: } Then you The second part can see the key of the session , so when I log in to the user, I will add a session to my project: So I've added a session file manager , and I've been added to Jason Config File . But it does not work. Best regards It is to correct that program Did what i had issue issue GetSetting ("FILES_ROOT"); If (_context.Session ["SESSION_PATH_KEY"]! = Null) ret = (string) _contact Session [gatesetting ("session_path_akeai")]; If (rate == "") ret = _context.Server.MapPath ("../upload"); else ret = fiasco (rate); Return writ; } to: In the conf.json I left the FILES_ROOT variable blank and set the "session IFILE_PATH": "session FILEPATH" In my login script where we session Sets: "SESSIONFILEPATH]] =" ~ / assests / 1 / "; From here you should be able to dynamically change your folder location, which I am doing, but For this example I have left it I did not have MVC but for this I should work for it. I hope that You are helpful, if it votes please =) Cheers!
{"FILES_ROOT": "Fileman / Upload "," "File_type_kenny": "file", "THUMBS_VIEW_WIDTH": "140", "THUMBS_VIEW_HEIGHT": "120", "PREVIEW_THUMB_WIDTH": "300", "PREVIEW_THUMB_HEIGHT": "200", "MAX_IMAGE_WIDTH": "0" "ASP_net / Main.Shex? A = Created", " Dealederer ":" ASP_net / MAN.assx "ADELEDED IR "," MOVEDIR ":" ASP_net / Main.Shex? A = MoVEDIR "," Copdier ":" ASP_net / Main.Shex? A = Copdier "," Richie Dar ":" ASP_net / Main ASP_net / main.hex? A = Upload "," Download ":" ASP_net / Main.Shex "," ASP_net / Main.Shex? A = FILESLIST "," upload "? A = download", "DOWNLOADDIR": "asp_net / main.ashx one = DOWNLOADDIR", "DOWNLOADDIR?": "Asp_net / main.ashx one = DOWNLOADDIR", "DELETEFILE?": "asp_net / main.ashx A = DELETEFILE", "MOVEFILE": "asp_net / main.ashx? A = MOVEFILE", "coffeefile": "asp_net / main.ashx? A = COPYFILE" "RENAMEFILE": "asp_net / main ".hx A = RENAMEFILE", "GENERATETHUMB?": "Asp_net / main.ashx one = GENERATETHUMB", "defaultView?": "List", "FORBIDDEN_UPLOADS": "zip js jsp jsb mHTML mht xhtml xht php phtml php3 php4 php5 Phps shtml jhtml pls py cgi exe scr dll MSI vbs bat com pif cmd vxd cpl htpasswd "," ALLOWED_UPLOADS ":" jpg "," FILEPERMISSIONS ":" 0644 "," DIRPERMISSIONS ":" 0755 "," LANG ": "Auto", "DATEFORMAT": "dd / MM / yyyy HH: mm"
Public Function Log (Login mode) model, string return url) {if (ModelState.IsValid & amp; WebSecurity.Login (model.UserName, model.Password, persistCookie: model.RememberMe)) session {add ("FileManager", true); Return Redirected Local (Return URL); } // If we found this much, then something failed, modify the model model. AddModelError ("", "The supplied username or password is incorrect."); See Return (Model); }
protected string GetFilesRoot () {string ret = GetSetting ("FILES_ROOT"); If (GetSetting ("SESSION_PATH_KEY")! = Null) ret = (string) _contact Session [GetSetting ("SESSION_PATH_KEY")]; If (rate == "") ret = _context.Server.MapPath ("../ upload"); Else ret = fix path (rate); Return writ; }
Comments
Post a Comment