(1)定義其允許上傳的最大(dà)值。
這個是在fckeditor\editor\filemanager\connectors\asp\config.asp中修改的。在文件(jiàn)的最後添加如(rú)下代碼:
ASP/Visual Basic代碼
- Dim LinkUploadLimit,ImageUploadLimit,FlashUploadLimit,AttachUploadLimit,MediaUploadLimit
- Dim LinkUploadMaxsize,ImageUploadMaxsize,FlashUploadMaxsize,AttachUploadMaxsize,MediaUploadMaxsize
-
- LinkUploadLimit = True
- LinkUploadMaxsize = 1024
-
- ImageUploadLimit = True
- ImageUploadMaxsize = 2048
-
- FlashUploadLimit = True
- FlashUploadMaxsize = 2048
-
- MediaUploadLimit = True
- MediaUploadMaxsize = 2048
-
- AttachUploadLimit = True
- AttachUploadMaxsize = 2048
FckEditor針對不同的上傳方式将上傳文件(jiàn)分(fēn)爲link,Image,Flash,Media等類型(Attach類型爲我添加的),分(fēn)别對應Fckeditor工(gōng)具欄上各個按鈕的上傳,如(rú)link對應使用超鏈接按鈕創建超鏈接時上傳的文件(jiàn)。因此這裡(lǐ)對每種類型定義了兩個變量一個用來(lái)設定是否開啓上傳限制,一個是上傳的最大(dà)值,單位爲k。
(2)判斷上傳的文件(jiàn)是否超過限制。
這個是在fckeditor\editor\filemanager\connectors\asp\commands.asp中修改的。
在172行之後即語句sOriginalFileName = sFileName之後添加如(rú)下代碼
ASP/Visual Basic代碼
-
- Dim dFileSize,UploadLimitMaxsize,IsUploadLimit,IsLimitOk
-
-
- dFileSize=oUploader.File( "NewFile" ).Size/1024
-
- select case sResourceType
- case "File"
- IsUpLoadLimit=LinkUploadLimit
- UploadLimitMaxsize=LinkUploadMaxsize
- case "Image"
- IsUpLoadLimit=ImageUploadLimit
- UploadLimitMaxsize=ImageUploadMaxsize
- case "Flash"
- IsUpLoadLimit=FlashUploadLimit
- UploadLimitMaxsize=FlashUploadMaxsize
- case "Media"
- IsUpLoadLimit=MediaUploadLimit
- UploadLimitMaxsize=MediaUploadMaxsize
- case "Attach"
- IsUpLoadLimit=AttachUploadLimit
- UploadLimitMaxsize=AttachUploadMaxsize
-
- case else
-
- IsUploadLimit=True
- UploadLimitMaxsize=102400
- end select
-
-
- IsLimitOk=False
- if IsUploadLimit then
- if dFileSize > UploadLimitMaxsize then
- IsLimitOk = True
- sErrorNumber = "204"
- end if
- end if
-
修改172行後的 DO While ……loop語句
Do While ( True )改爲 Do While ( not IsLimitOk )
(3)定義客戶端的錯誤提示信息。
客戶端錯誤提示信息在每一類上傳(如(rú) link、image)對應的文件(jiàn)夾中的js文件(jiàn)中修改。
link:在fckeditor\editor\dialog\fck_link\下的fck_link.js中修改
修改函數function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )中的switch …case 語句
即下列語句之後
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
r
文章(zhāng)整理(lǐ):
世紀雲圖 /
以上信息與文章(zhāng)正文是不可(kě)分(fēn)割的一部分(fēn),如(rú)果您要轉載本文章(zhāng),請(qǐng)保留以上信息,謝謝!
版權申明:本站(zhàn)文章(zhāng)部份來(lái)自(zì)網絡,如(rú)有侵權,請(qǐng)聯系我們,我們收到後立即删除,謝謝!
特别注意:本站(zhàn)部份轉載文章(zhāng)言論不代表本站(zhàn)觀點,本站(zhàn)所提供的攝影(yǐng)照(zhào)片,插畫(huà),設計(jì)作(zuò)品,如(rú)需使用,請(qǐng)與原作(zuò)者聯系,版權歸原作(zuò)者所有。