一聚教程网:一个值得你收藏的教程网站

热门教程

fckeditor文件上传路径修改方法

时间:2022-06-25 04:06:57 编辑:袖梨 来源:一聚教程网

VS打开FCK项目,打开文件“FCKeditor.Net_2.6.3FileBrowserFileWorkerBase.cs”

找到这行

C# code
// Map the virtual path to the local server path.
string sServerDir = this.ServerMapFolder( resourceType, currentFolder, isQuickUpload );

//如果不关心按类型存放文件的话,FCK把类型分为image,media,flash,file
//直接修改成这样

string sServerDir = "d:somedir"; //注意这个目录必须给ASP.net读写权限

修改完成后重新编译整个项目,然后把重新生成的FredCK.FCKeditorV2.dll拷贝到你的网站


以下这个方法可以上传保存,但显示会有问题,因为路径不对:
定位到文件“fckeditoreditorfilemanagerconnectorsasp教程xconfig.ascx”并打开它,找到下面这个片段,按我标注的注释改

C# code
// URL path to user files.
UserFilesPath = "/uploadfiles/";

// The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:MySiteuserfiles' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = "";

//把上面的“UserFilesAbsolutePath”修改为你自己的物理路径,
//但这样的话在网站里访问上传的文件就有问题了,你试下便知
//注意最后一句注释“Attention: The above 'UserFilesPath' URL must point to the same directory.”
//“UserFilesPath”和“UserFilesAbsolutePath”必须指向相同的文件夹,
//而且UserFilesPath只能是相对路径或虚拟路径

热门栏目