(1)定义其允许上传的最大值。
这个是在fckeditor\editor\filemanager\connectors\asp\config.asp中修改的。在文件的最后添加如下代码:
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针对不同的上传方式将上传文件分为link,Image,Flash,Media等类型(Attach类型为我添加的),分别对应Fckeditor工具栏上各个按钮的上传,如link对应使用超链接按钮创建超链接时上传的文件。因此这里对每种类型定义了两个变量一个用来设定是否开启上传限制,一个是上传的最大值,单位为k。
(2)判断上传的文件是否超过限制。
这个是在fckeditor\editor\filemanager\connectors\asp\commands.asp中修改的。
在172行之后即语句sOriginalFileName = sFileName之后添加如下代码
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)定义客户端的错误提示信息。
客户端错误提示信息在每一类上传(如 link、image)对应的文件夹中的js文件中修改。
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
文章整理:
世纪云图 https://www.yuntop.cc/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!
版权申明:本站文章部份来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站部份转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。