//Function to add pic
function Addpic(imagePath){
window.opener.frames.message.focus();
window.opener.frames.message.document.execCommand(InsertImage, false, imagePath);
}
// -->
</script>
<% server.scripttimeout=1900 %>
<%
UpFilePath="NewsIMG/"
fileweb="UPLOAD/"
nameset =1
pathset =0
dim i
i=1
%>
<%
function makefilename(fname)
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
makefilename=fname
end function
%>
<!--#include FILE="upload_5xsoft.inc"-->
<%
dim upload,file,formName,iCount
dim url,url1
set upload=new upload_5xSoft 建立上传对象
iCount=0
for each formName in upload.file 列出所有上传了的文件
set file=upload.file(formName) 生成一个文件对象
if file.FileSize>0 then 如果 FileSize > 0 说明有文件数据
fname = makefilename(now()) & iCount & "." & GetExtendName(file.FileName)
file.SaveAs Server.mappath(UpFilePath&fname) 保存文件
iCount=iCount+1
response.write"图片"&i&" <input type=""text"" name="""&i&""" size=""55"" style=""border-style: solid; border-width: 1"" value=""../"&fileweb&UpFilePath&fname&"""><br>[ <a href=# onclick=""Addpic(../"&fileweb&UpFilePath&fname&")"">点击这里把图片"&i&"添加到编辑器中</a> ]<br>"
i=i+1
set file=nothing
end if
next
set upload=nothing 删除此对象
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
%>