知识库
Web开发技术
三、修改打开文件上传
文件:FCKeditor\editor\filemanager\connectors\asp\config.asp
a)使配置生效
ConfigIsEnabled = True
b)设置上传目录
修改
ConfigUserFilesPath = "/yourpath/" '"/userfiles/"
c)修改上传到当天的目录下,比如:"image/2008-7-1/7say.gif","file/2008-7-1/7say.rar",
ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/" '增加& "file/"
ConfigQuickUploadPath.Add "File", ConfigUserFilesPath & "file/" & date '增加& "file/" & date
ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/" '增加& "image/"
ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath & "Image/" & date '增加& "Image/" & date
ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/" '增加& "flash/"
ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath & "Flash/" & date '增加& "Flash/" & date
ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/" '增加& "media/"
ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath & "Media/" & date '增加& "Media/" & date
'这样修改可快速上传,并且浏览服务器可查看并选择已上传的图片,亲自测试通过。
========================================================================================
四、修改上传生成随机文件名
文件:FCKeditor\editor\filemanager\connectors\asp\commands.asp
在文件最下面加如下方法:
'//取得一个不重复的序号,生成随机文件名
Public Function GetNewID()
dim ranNum, dtNow
randomize
dtNow=Now()
ranNum=int(90*rnd)+10
GetNewID=year(dtNow) & right("0" & month(dtNow),2) & right("0" & day(dtNow),2) & right("0" & hour(dtNow),2) & right("0" & minute(dtNow),2) & right("0" & second(dtNow),2) & ranNum
End Function
'========================
修改163-165行
' Get the uploaded file name.
sFileName = oUploader.File( "NewFile" ).Name
sExtension = oUploader.File( "NewFile" ).Ext
为
' Get the uploaded file name.
sExtension = oUploader.File( "NewFile" ).Ext
'sFileName = oUploader.File( "NewFile" ).Name
sFileName = GetNewID() &"."& sExtension '<--修改的行
========================================================================================
五、修改快速上传中文乱码(网上看到的,本人未遇到过)
文件:FCKeditor\editor\filemanager\connectors\asp\io.asp
修改215行:
在Response.Clear后增加两行:
Response.CodePage=65001 '<----新增加的行
Response.Charset="UTF-8" '<----新增加的行