This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17006|Reply: 0

[ASP.NET] For security reasons, the file cannot be viewed. Please contact your system administrator and check the CKFinder profile.

[Copy link]
Posted on 4/18/2015 10:08:03 AM | | |

When using CKFINDER to upload files, the error "Due to security reasons, the file cannot be viewed. Please contact your system administrator and check the CKFinder profile.", the reason for this prompt is:

There's a public override bool CheckAuthentication() in ckfinder/config.ascx

default is return false;

// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
Understand this passage.

If it is a test, use return true directly;
Official version: Add one to the login place: Session[ "IsAuthorized" ] = true;

Here it is changed to
public override bool CheckAuthentication()
{
return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
}




Previous:SQL Server determines whether there are databases, tables, columns, and views
Next:asp.net space dropdownlist bind database
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com