当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp fckeditor自定义上传文件的文件名

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 asp fckeditor自定义上传文件的文件名


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 312 ::
收藏到网摘: n/a

上传文件时如果遇到中文就很麻烦,但又不能让用户自己把文件名改后再上传,所以直接把文件名自动生成了一下。 只需要在fckeditor\editor\filemanager\connectors\asp文件夹下的commands.asp修改一下即可
在这个文件中查找一下:FileUpload
会找到这个函数

复制代码 代码如下:

Dim sFilePath
sFilePath = CombineLocalPaths(sServerDir, sFileName)

改为
复制代码 代码如下:

Dim sFilePath,ranNum
Randomize
ranNum=int(90000*rnd)+10000
sFilePath = CombineLocalPaths(sServerDir, year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&sExtension)

即可