當前位置:首頁 » 文件管理 » fckeditor上傳文件

fckeditor上傳文件

發布時間: 2022-05-20 17:20:28

① fckeditor 編輯器快速上傳圖片

引用:http://student.csdn.net/space.php?uid=53812&do=blog&id=28068
有問題可以和我聊,我也正在研究這個東東

快速上傳:
FCKeditor\editor\filemanager\upload\
asp\
23 ConfigIsEnabled = False
是否啟用快速上傳
27 ConfigUserFilesPath = "/UserFiles/"
如果想上傳到 /test/upload/yyymmdd/的文件夾下面
則修改為 ConfigUserFilesPath = "/test/upload/" & year(now())& right("0"& month(now()),2)&right("0" & day(now()),2)

php與asp 不同的地方
php上傳設置

FCKeditor\editor\filemanager\browser\default\connectors\php下面
config.php

$Config['Enabled'] = true ; 啟用上傳

$Config['UserFilesPath'] = '/test/upload/' ; url顯示出來的路徑,

$Config['UserFilesAbsolutePath'] = 'e:/web/upload' ;伺服器上的真實路徑,建議配置上這個。否則可能出現失去響應的情況

相應文件類型設置:39-40行
connector.php
71行
if ( !in_array( $sResourceType,array('File','Image','Flash','Media') ) )
return ;

]
表示文件類型

快速上傳FCKeditor\editor\filemanager\upload\php
config.php

$Config['Enabled'] = true ;//啟用

// Path to uploaded files relative to the document root.
$Config['UserFilesPath'] = '/test/upload/' ;這是url相對文檔根

$Config['UserFilesAbsolutePath'] = 'e:/web/upload/' ;這才是伺服器上的絕對路徑 建議與上面u那個路徑同時都配置上,如果出現了php上傳沒有反映的問題則可能是這個沒有配置。

② 關於FCKeditor中java的文件上傳創建中文文件夾亂碼問題

我最近也在弄這個,解決了部分亂碼問題
你看你有這個jar包嗎?沒有就下一個:fckeditor-java-core-2.4.jar
重寫這個類:ConnectorServlet.java
1.解決新建文件夾亂碼:

③ FCKeditor如何安全配置才能不讓非法上傳文件

打開位於FCKeditor安裝目錄 editor/filemanager/browser/default/connectors/asp/文件夾中的config.asp文件,將其中的 ConfigIsEnabled參數後面的值改為False,這樣做的目的是將FCKeditor的文件上傳功能關閉,漏洞當然也就無法被黑客利用了。
其實最簡單的方法就是升級FCKeditor的版本,升級後漏洞就不存在了。

④ ckeditor怎麼配置上傳文件

想把java web項目中的fckeditor在線文本編輯器升級到ckeditor,但又不想購買ckfinder來實現文件上傳?老k將告訴你一個不用花錢就可以實現ckeditor上傳文件的好方法,只要對fckeditor的filemanager做出幾處修改,就可以集成fckeditor的文件上傳管理器到ckeditor中使用,可以方便在文章中插入圖片及flash。 1.在java web項目中集成fckeditor
如果你是把fckeditor升級到ckeditor的話,可以跳過這一步,否則請下載fckeditor的最終版本,然後把fckeditor文件夾復制到java web項目的webroot目錄下。當然,你可以直接下載本文的示例項目fckeditro文件上傳管理器集成到ckeditor示例項目 (0)來獲得最終版本的fckeditor,而且是已經可以集成到ckeditor的fckeditor。 2.把java實現文件上傳需要的jar復制到項目lib目錄下
下載本文的示例項目後解壓,把項目lib目錄下的所有jar文件復制到你的項目的lib下面,如果不是通過myeclipse或者eclipse進行粘貼的話,你還需要把這些jar加入到項目編譯路徑下。
3.重寫fckeditor實現文件上傳的ConnectorServlet以解決中文亂碼的問題
你可以直接到本文示例項目net.laokboke.servlet目錄下的ConnectorServlet.java復制到你的項目的src目錄下。
4.實現fckeditor的connector.userActionImpl
其實只需要把fckeditor.properties文件復制到你項目的src目錄下就可以了 5.配置你的web.xml文件
配置上傳文件的servlet,使tomcat啟動的時候就載入該servlet,在web.xml中加入以下的代碼:
<servlet>
<servlet-name>Connector</servlet-name> <servlet-class>
net.laokboke.servlet.ConnectorServlet
</servlet-class>

<init-param>
<param-name>baseDir</param-name> <param-value>/userfiles/</param-value> </init-param>
<init-param>
<param-name>debug</param-name> <param-value>true</param-value> </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping> <servlet-name>Connector</servlet-name>
<url-pattern>/fckeditor/connector</url-pattern>

</servlet-mapping>
6.修改fckeditor文件上傳管理器的若干文件
這些文件全部位於fckeditor\editor\filemanager\browser\default\目錄下,你只需要把本文的示例項目中同目錄下的所有文件復制替換你的就可以了。 7.修改ckeditor的圖像屬性窗口js,屏蔽一些不必要的選項
該文件是位於ckeditor\plugins\image\dialogs\目錄下的image.js文件,增加了291-293這幾行代碼。
8.在ckeditor集成fckeditor filemanager
其實就是在使用ckeditor時配置它的filebrowserBrowseUrl和filebrowserUploadUrl等屬性,如以下js代碼
<script type="text/javascript"> CKEDITOR.replace( 'editor1', {
filebrowserBrowseUrl :
'<%=path %>/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=/fckeditor/connector', filebrowserUploadUrl : '<%=path %>/fckeditor/connector?Type=Image'
}); </script>

⑤ fckeditor上傳的文件夾沒有執行許可權怎麼突破

定義一個文件格式類型的數組,如String[] type ={ ".gif", ".jpg", ".bmp", ".swf" };然後循環遍歷這個數組,用你上傳的文件的文件名的後綴,去做對比(文件名.endsWith(type[temp]))),如果對上了,則讓上傳,否則不讓上傳~~~

⑥ FCKeditor 上傳文件大小如何限制

方法如下:
/// 獲取允許上傳的類型
/// </summary>
protected string UserUploadType
...{
get
...{
if (sUserUploadType == null)
...{
// Try to get from the "Application".
sUserUploadType = (string)Application["FCKeditor:UserUploadType"];
// Try to get from the "Session".
if (sUserUploadType == null || sUserUploadType.Length == 0)
...{
sUserUploadType = (string)Session["FCKeditor:UserUploadType"];
// Try to get from the Web.config file.
if (sUserUploadType == null || sUserUploadType.Length == 0)
...{
sUserUploadType = System.Web.Configuration.WebConfigurationManager.AppSettings["FCKeditor:UserUploadType"];
// Otherwise use the default value.
if (sUserUploadType == null || sUserUploadType.Length == 0)
sUserUploadType = DEFAULT_USER_FILES_UPLOADTYPE;
}
}
// Check that the user path starts and ends with slash (".")
if (!sUserUploadType.StartsWith("."))
sUserUploadType = "." + sUserUploadType;
if (!sUserUploadType.EndsWith("."))
sUserUploadType += ".";
}
return sUserUploadType;
}
}
/**//// <summary>
/// 獲取允許上傳的文件最大限制
/// </summary>
protected int UserUploadSize
...{
get
...{
if (iUserUploadSize < 1)
...{
iUserUploadSize = Convert.ToInt32(Application["FCKeditor:UserUploadSize"]);
if (iUserUploadSize < 1)
...{
iUserUploadSize = Convert.ToInt32(Session["FCKeditor:UserUploadSize"]);
if (iUserUploadSize < 1)
...{
iUserUploadSize = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["FCKeditor:UserUploadSize"]);
if (iUserUploadSize < 1)
...{
iUserUploadSize = DEFAULT_USER_FILES_UPLOADSIZE;
}
}
}
}
return iUserUploadSize;
}
}
}
}
接著就是對點擊"瀏覽伺服器"頁面的上傳部分的修改
以下是對FileBrowserConnector.cs中的FileUpload()函數的修改
private void FileUpload(string resourceType, string currentFolder)
...{
HttpPostedFile oFile = Request.Files["NewFile"];
string sErrorNumber = "0";
string sFileName = "";
if (oFile != null && oFile.ContentLength > 0)
...{
// Map the virtual path to the local server path.
string sServerDir = this.ServerMapFolder(resourceType, currentFolder);
/**//*
// Get the uploaded file name.
sFileName = System.IO.Path.GetFileName( oFile.FileName ) ;
int iCounter = 0 ;
while ( true )
{
string sFilePath = System.IO.Path.Combine( sServerDir, sFileName ) ;
if ( System.IO.File.Exists( sFilePath ) )
{
iCounter++ ;
sFileName =
System.IO.Path.GetFileNameWithoutExtension( oFile.FileName ) +
"(" + iCounter + ")" +
System.IO.Path.GetExtension( oFile.FileName ) ;
sErrorNumber = "201" ;
}
else
{
oFile.SaveAs( sFilePath ) ;
break ;
}
}
*/
if (this.UserUploadType.ToLower().IndexOf(System.IO.Path.GetExtension(oFile.FileName).ToLower() + ".") > -1)//檢測是否為允許的上傳文件類型
...{
if (this.UserUploadSize * 1024 >= oFile.ContentLength)//檢測文件大小是否超過限制
...{
sFileName = DateTime.Now.ToString("yyyyMMddHHmmssffff") + System.IO.Path.GetExtension(oFile.FileName);
string sFilePath = System.IO.Path.Combine(sServerDir, sFileName);
oFile.SaveAs(sFilePath);
}
else//文件大小超過限制
...{
Response.Clear();
Response.Write("<script type="text/javascript">");
Response.Write("window.parent.frames['frmUpload'].OnUploadCompleted(1,'上傳文件大小超出限制') ;");
Response.Write("</script>");
Response.End();
}
}
else //文件類型不允許上傳
...{
Response.Clear();
Response.Write("<script type="text/javascript">");
Response.Write("window.parent.frames['frmUpload'].OnUploadCompleted(1,'上傳文件類型不允許') ;");
Response.Write("</script>");
Response.End();
}

}
else
sErrorNumber = "202";
Response.Clear();
Response.Write("<script type="text/javascript">");
Response.Write("window.parent.frames['frmUpload'].OnUploadCompleted(" + sErrorNumber + ",'" + sFileName.Replace("'", "/'") + "') ;");
Response.Write("</script>");
Response.End();
}
最後就是對Uploader.cs類中的OnLoad()函數的修改
protected override void OnLoad(EventArgs e)
...{
// Get the posted file.
HttpPostedFile oFile = Request.Files["NewFile"];
// Check if the file has been correctly uploaded
if (oFile == null || oFile.ContentLength == 0)
...{
SendResults(202);
return;
}
int iErrorNumber = 0;
string sFileUrl = "";
string sFileName = "";
//使用原文件名上傳代碼,如果文件名相同,則在後面加上標號(1)(2)...
/**//*
// Get the uploaded file name.
string sFileName = System.IO.Path.GetFileName( oFile.FileName ) ;

int iCounter = 0 ;
while ( true )
{
string sFilePath = System.IO.Path.Combine( this.UserFilesDirectory, sFileName ) ;
if ( System.IO.File.Exists( sFilePath ) )
{
iCounter++ ;
sFileName =
System.IO.Path.GetFileNameWithoutExtension( oFile.FileName ) +
"(" + iCounter + ")" +
System.IO.Path.GetExtension( oFile.FileName ) ;
iErrorNumber = 201 ;
}
else
{
oFile.SaveAs( sFilePath ) ;
sFileUrl = this.UserFilesPath + sFileName ;
break ;
}
}
*/
//使用原文件名上傳代碼結束
//使用時間作為流水號文件名

if (this.UserUploadSize * 1024 >= oFile.ContentLength)//檢測文件大小是否超過限制
...{
sFileName = DateTime.Now.ToString("yyyyMMddHHmmssffff") + System.IO.Path.GetExtension(oFile.FileName);
string sFilePath = System.IO.Path.Combine(this.UserFilesDirectory, sFileName);
oFile.SaveAs(sFilePath);
sFileUrl = this.UserFilesPath + sFileName;
}
else//文件大小超過限制
...{
SendResults(1, "", "", "上傳文件大小超出限制");
}
/**//////////////////////////////////////////////////////////////////////////////
SendResults(iErrorNumber, sFileUrl, sFileName);
}
最後只要在Web.Config文件中加入對文件上傳的限制值就可以了.
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="FCKeditor:UserFilesPath" value="/UserFiles/" />
<add key="FCKeditor:UserUploadType" value=".gif.jpg.jpeg.rar.zip.swf.png" />
<add key="FCKeditor:UserUploadSize" value="5120" /><!--單位為KB-->
</appSettings>
<system.web>
<httpRuntime maxRequestLength="512000" />
</system.web>

</configuration>

⑦ FCKeditor_2.6.3 如何設置上傳文件類型比如增加.docx文件類型支持,或者把上傳文件限制出掉也可以

找到FCKeditor\editor\filemanager\connectors\asp\ 文件夾下的confit.asp文件,找到下面的這一行!

ConfigAllowedExtensions.Add "File", "7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip"

加入你要的擴展名,當然這里有「File,Image,Flash,Media」4個類別設置,隨你選哪一個加進去就可以了!注意和其它的擴展名用「|」符號分開

⑧ fckeditor 怎麼上傳圖片怎麼用

先點擊「上傳」,在上傳的界面選擇需要上傳的文件,然後點擊發送的伺服器,你的「圖像」下的源文件框框自然就有值了,根本不用你輸。
如果你伺服器上已經上傳的有文件了,可以點擊瀏覽伺服器,從中選擇一個文件就可以了,源文件的框框自然就會有值了。
然後再點擊確定就可以了

⑨ FCKeditor如何使用

FCKEDITOR使用說明2008-01-29 12:11一、FCKEDITOR類參考:

構造器:
FCKeditor( instanceName[, width, height, toolbarSet, value] )
instanceName:編輯器的唯一名稱(相當於ID)
WIDTH:寬度
HEIGHT:高度
toolbarSet:工具條集合的名稱
value:編輯器初始化內容

屬性:
instanceName:編輯器實例名
width:寬度,默認值為100%
height:高度,默認值是200
ToolbarSet:工具集名稱,參考FCKCONFIG.JS,默認值是Default
value:初始化編輯器的HTML代碼,默認值為空
BasePath:編輯器的基路徑,默認為/Fckeditor/文件夾,注意,盡量不要使用相對路徑.最好能用相對於站點根路徑的表示方法,要以/結尾
CheckBrowser:是否在顯示編輯器前檢查瀏覽器兼容性,默認為true
DisplayErrors:是否顯示提示錯誤,默為true;

集合:
Config[Key]=value;

這個集合用於更改配置中某一項的值,如
oFckeditor.Config["DefaultLanguage"]="pt-br";

方法:
Create() 建立並輸出編輯器
RepaceTextArea(TextAreaName) 用編輯器來替換對應的文本框

二、配置FCKEDITOR
主配置文件名為Fckconfig.js

FCKEDITOR提供了一套用於定製其外觀,特性及行為的設置集.你既可以編輯主配置文件,也可以自己定義單獨的配置文件.配置文件使用JAVASCRIPT語法.

修改後,在建立編輯器時,可以使用以下語法:
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.Config['CustomConfigurationsPath'] = '/myconfig.js' ;
oFCKeditor.Create() ;

提醒:當你修改配置後,請清空瀏覽器緩存以查看效果

配置選項:
AutoDetectLanguage=true/false 自動檢測語言
BaseHref="" 相對鏈接的基地址
ContentLangDirection="ltr/rtl" 默認文字方向
ContextMenu=字元串數組,右鍵菜單的內容
CustomConfigurationsPath="" 自定義配置文件路徑和名稱
Debug=true/false 是否開啟調試功能,這樣,當調用FCKDebug.Output()時,會在調試窗中輸出內容
DefaultLanguage="" 預設語言
EditorAreaCss="" 編輯區的樣式表文件
EnableSourceXHTML=true/false 為TRUE時,當由可視化界面切換到代碼頁時,把HTML處理成XHTML
EnableXHTML=true/false 是否允許使用XHTML取代HTML
FillEmptyBlocks=true/false 使用這個功能,可以將空的塊級元素用空格來替代
FontColors="" 設置顯示顏色拾取器時文字顏色列表
FontFormats="" 設置顯示在文字格式列表中的命名
FontNames="" 字體列表中的字體名
FontSizes="" 字體大小中的字型大小列表
ForcePasteAsPlainText=true/false 強制粘貼為純文本
ForceSimpleAmpersand=true/false 是否不把&符號轉換為XML實體
FormatIndentator="" 當在源碼格式下縮進代碼使用的字元
FormatOutput=true/false 當輸出內容時是否自動格式化代碼
FormatSource=true/false 在切換到代碼視圖時是否自動格式化代碼
FullPage=true/false 是否允許編輯整個HTML文件,還是僅允許編輯BODY間的內容
GeckoUseSPAN=true/false 是否允許SPAN標記代替B,I,U標記
IeSpellDownloadUrl=""下載拼寫檢查器的網址
ImageBrowser=true/false 是否允許瀏覽伺服器功能
ImageBrowserURL="" 瀏覽伺服器時運行的URL
ImageBrowserWindowHeight="" 圖像瀏覽器窗口高度
ImageBrowserWindowWidth="" 圖像瀏覽器窗口寬度
LinkBrowser=true/false 是否允許在插入鏈接時瀏覽伺服器
LinkBrowserURL="" 插入鏈接時瀏覽伺服器的URL
LinkBrowserWindowHeight=""鏈接目標瀏覽器窗口高度
LinkBrowserWindowWidth=""鏈接目標瀏覽器窗口寬度
Plugins=object 注冊插件
PluginsPath="" 插件文件夾
ShowBorders=true/false 合並邊框
SkinPath="" 皮膚文件夾位置
SmileyColumns=12 圖符窗列數
SmileyImages=字元數組 圖符窗中圖片文件名數組
SmileyPath="" 圖符文件夾路徑
SmileyWindowHeight 圖符窗口高度
SmileyWindowWidth 圖符窗口寬度
SpellChecker="ieSpell/Spellerpages" 設置拼寫檢查器
StartupFocus=true/false 開啟時FOCUS到編輯器
StylesXmlPath="" 設置定義CSS樣式列表的XML文件的位置
TabSpaces=4 TAB鍵產生的空格字元數
ToolBarCanCollapse=true/false 是否允許展開/折疊工具欄
ToolbarSets=object 允許使用TOOLBAR集合
ToolbarStartExpanded=true/false 開啟是TOOLBAR是否展開
UseBROnCarriageReturn=true/false 當回車時是產生BR標記還是P或者DIV標記

三、自定義樣式列表
FckStyls.xml是默認的自定義樣式列表文件。
FCKEDITOR的樣式工具欄中提供了預定義的樣式,樣式是通過XML文件定義的,默認的XML樣式文件存在於FCkEditor根文件夾下的FckStyls.xml文件中這個XML文件的結構分析如下:

<?xml version="1.0" encoding="utf-8" ?>
<Styles >
<Style name="My Image" element="img">
<Attribute name="style" value="padding: 5px" />
<Attribute name="border" value="2" />
</Style >
<Style name="Italic" element="em" />
<Style name="Title" element="span">
<Attribute name="class" value="Title" />
</Style >
<Style name="Title H3" element="h3" />
</Styles>

每一個STYLE標記定義一種樣式,NAME是顯示在下拉列表中的樣式名,ELEMENT屬性指定此樣式所適用的對象,因為FCKEDITOR中的樣式是上下文敏感的,也就是說,選擇不同的對象,僅會顯示針對這類對象定義的樣式

四、拼寫檢查

FCKEDITOR 帶了兩種拼寫檢查工具,一種是ieSpell,默認情況下使用這種,使用這種方式的拼寫檢查,要求客戶下載並安裝iespell這個小軟體,另外,也提供 SpellPager的方式來進行拼寫檢查,不過,由於SPELLPAGER是由PHP編寫的伺服器端腳本,因此,要求你的WEB伺服器必須支持PHP腳本語言方可
更改拼寫檢查器的方式請參見有關配置文件的詳細說明

五、壓縮腳本

為了提供腳本載入的效率,FCKEDITOR採用以下方法對腳本盡量壓縮以減少腳本尺寸:
1,移除掉腳本中的注釋
2.移除掉腳本中所有無意義的空白
另外,FCKEDITOR還提供了一個專門用於壓縮腳本的工具以便 你在發布時能減小文件尺寸,你可以將_Packager文件夾中的Fckeditor.Packager.exe復制到FCKEDITOR根文件夾來運行並壓縮腳本

六、本地化FCKEDITOR
如果FCKEDITOR沒有提供您所需要的語言(實際上全有了),你也可以自行製作新的語言,你只需要復制出EN.JS,然後在其基礎上進行翻譯.另外,語言名稱與對應的腳本文件名必須遵循RFC 3066標准,但是,需要小寫,例如:Portuguess Language對應的腳本文件名必須為pt.js如果需要針對某個國家的某種語系,則可以在語系縮寫後加上橫線及國家縮寫即可

在使用時,系統會自動偵測客戶端語系及國別而運用適當的界面語言.

當建立一種新的語言後,你必須在"Edit/lang/fcklanguagemanager.js"中為其建立一個條目,如下所示:
FCKLanguageManager.AvailableLanguages =
{

en : 'English',
pt : 'Portuguese'
}

需要提醒的是,文件必須保存為UTF-8格式

六、與ASP.NET伺服器端腳本進行交互
1.把FCKEDITOR添中到工具箱
2.托拽FCKEDITOR控制項到頁面
3.為其指定名稱
4.FCKEDITOR 類的所有屬性不光可以在代碼中使用,而且可以作為FCKEDITOR控制項的屬性直接使用,例如,要改變皮膚,可以在UI頁面中指定SkinPath= "/fckeditor/editor/skins/office2003"即可,其實FCKEDITOR的ASP.NET版本可以做得更好,你可以找到 FCKEDITOR ASP.NET 2.1的源文件,然後修改該控制項的設計,為其暴露更多有用的屬性,重新編譯即可
5,POSTBACK後的數據,使用FCKEDITOR控制項的value屬性獲得
6. 由於默認狀態下,ASP.NET不允許提交含有HTML及JAVASCRIPT的內容,因此,你必須將使用FCKEDITOR的頁面的 ValidateRequest設為false.(<%@page validteRequest="false" %>即可)

七、設置上傳文件語言

把FCKeditor根目錄下面的fckconfig.js文件里

var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php

這兩行中改成您所需要調用的編輯器語言,如用asp.net則改為aspx;

八、解決中文的問題:
在web.config中加入:
<globalization requestEncoding="GB2312" responseEncoding="GB2312"/>
這樣設置後可以顯示中文的文件,但URL地址也是中文的;
如果伺服器對中文地址的解析不好,可能導致圖片無法瀏覽;
所以修改:editor\filemanager\browser\default\frmresourceslist.html
中的OpenFile函數,把
window.top.opener.SetUrl( fileUrl ) ;
修改為:
window.top.opener.SetUrl( escape(fileUrl) ) ;

九.設置上傳的目錄:
1:在web.config中設置:
<appSettings>
<add key="FCKeditor:UserFilesPath" value="/fck/UpLoad/" />
</appSettings>

2:在Session中設置:
在editor\filemanager\browser\default\connectors\aspx\connector.aspx中加入以下代碼:
<script runat="server" language="C#">
protected override void OnInit(EventArgs e)
{
Session["FCKeditor:UserFilesPath"] = "/fck/UpLoad1/";
}
</script>

⑩ fckeditor上傳圖片問題 不能上傳

在FCKEditor2.4.1版在.net環境中圖片上傳的正確配置,以供大家參考,以少走彎路。
asp.net下的fckeditor2.4.1配置
用最簡單的語言描述一下。其它配置和優化就不說了,只說怎麼讓它在asp.net環境下能用,能上傳。
1、下載文件 http://www.fckeditor.net/download
FCKeditor_2.4.1.zip 和 FCKeditor.Net_2.2.zip
這是目前最新的版本。 FCKeditor_2.4.1.zip 為fckeditor的頁面文件 FCKeditor.Net_2.2.zip 是asp.net下的上傳用的 dll控制項和其源文件
2、 解壓FCKeditor_2.4.1.zip 到網站根目錄下的 fckeditor中,解壓FCKeditor.Net_2.2.zip 將其目錄 FCKeditor.Net_2.2\bin\Release中的 FredCK.FCKeditorV2.dll 復制到 根目錄的/bin/下
3、打開/fckeditor/fckconfig.js 修改兩行代碼
var _FileBrowserLanguage = 'aspx' ;
var _QuickUploadLanguage = 'aspx' ;
把默認的asp語言改成aspx
4、這就算行了,開始用吧。根目錄下建立test.aspx,其代碼如下:
<%@ Page language="c#" AutoEventWireup="false" validateRequest=false%>
<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<form id="Form1" method="post" runat="server">
<FCKeditorV2:FCKeditor id="content" runat="server"></FCKeditorV2:FCKeditor>
</form>
應該就ok了,可以上傳。默認傳到根目錄的/UserFiles/下,不用自己建,它自己會建。
如果要改上傳目錄,需要修改FCKeditor.Net_2.2.zip這個包里的.net源文件。修改FileWorkerBase.cs ,改一下26行
private const string DEFAULT_USER_FILES_PATH = "/UserFiles/" ;
重新編譯一下,生成新的dll,復制過去,應該就OK了。(這個我沒試,應該沒問題)
另外,說一句,fckeditor是很靈活的,可以做很多高級的設置。
還 有的網友,自己優化了它的源文件,有的給它加了功能,比如傳視頻,傳文件什麼的。 但這些修改過的版本,有的是有問題的。 曾經下過一個修改了的2.0 版本, asp下,怎麼設置都上傳不了圖片。 重新下個,隨便設置一下就可以了。所以,還是推薦大家用官方提供的版本。

熱點內容
網頁設置的密碼如何刪除 發布:2024-05-06 02:20:30 瀏覽:925
如何查看snmp配置信息 發布:2024-05-06 02:19:48 瀏覽:487
預科編程 發布:2024-05-06 02:19:42 瀏覽:138
壓縮比英文 發布:2024-05-06 01:56:35 瀏覽:171
數字php 發布:2024-05-06 01:53:10 瀏覽:742
編程中怎麼 發布:2024-05-06 01:43:32 瀏覽:629
如何訪問遠程資料庫 發布:2024-05-06 01:39:20 瀏覽:447
刷演算法的網站 發布:2024-05-06 01:30:39 瀏覽:270
少兒編程徐州 發布:2024-05-06 01:20:42 瀏覽:462
sqlserver連接驅動 發布:2024-05-06 00:33:34 瀏覽:646