马尔代夫六善:关于无组件上传 asp

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 04:43:50
下面是upfile.asp 的部分代码

case "jpg","gif","png","bmp"
strJS=strJS & "range.pasteHTML('<img src=" & filename & ">');" & vbcrlf
case "swf"
strJS=strJS & "range.pasteHTML('<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0>"
strJS=strJS & "<param name=movie value=" & FileName & ">"
strJS=strJS & "<param name=quality value=high>"
strJS=strJS & "<embed src=" & FileName & " quality=high pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash>"
strJS=strJS & "</embed></object>');" & vbcrlf

case else
strJS=strJS & "range.text='[upload=" & FileType & "]" & FileName & "[/upload]';" & vbcrlf

我是添加新闻中上传文件的,如果我上传的doc、xls、pds的话(是可以上传这类的文件),第一次添加后前台路径都不对,但是如果我点击修改新闻,重新进入一次后台的修改的页面,什么都不操作,然后直接保存,这样前台页面所有的连接都正确了。这是为什么啊?

下面是 ubbcode.asp 的部分代码
re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
strContent=re.Replace(strContent,"<a onfocus=this.blur() href=""$1://$2"" target=_blank><IMG SRC=""$1://$2"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></a>")
re.Pattern="\[UPLOAD=(gif|jpg|jpeg|bmp|png)\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/UPLOAD\]"
strContent= re.Replace(strContent,"<br><IMG SRC="""&ImagePath&"$1.gif"" border=0>此主题相关图片如下:<br><A HREF=""$2$1"" TARGET=_blank><IMG SRC=""$2$1"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></A>")

re.Pattern="\[UPLOAD=(.[^\[]*)\](.[^\[]*)\[\/UPLOAD\]"
strContent= re.Replace(strContent,"<br><IMG SRC="""&ImagePath&"$1.gif"" border=0> <a href=""$2"">Scan this file.</a>")