str = Replace(str,"?","")
str = Replace(str,"&","")
str = Replace(str,"/","")
str = replace(str,vbcrlf,"")
GetFileName = str
End Function
sub SaveFile(str,fName)
'-------------------------本函数为将流内容存盘的函数-------------------
'on error resume next
Set objStream = Server.CreateObject("ADODB.Stream")
'--------------建立ADODB.Stream对象,必须要ADO 2.5以上版本---------
'objStream.Type = adTypeBinary
objStream.Type = 1
'-------------以二进制模式打开-------------------------------------
objStream.Open
objstream.write str
'--------------------将字符串内容写入缓冲--------------------------
'response.Write fname
'路径注意
objstream.SaveToFile "E:\webroot\pcqc\vip\UploadFile\cache\"&fName,2
'objstream.SaveToFile "d:\cache\" & fName,adSaveCreateOverWrite
'--------------------将缓冲的内容写入文件--------------------------
'response.BinaryWrite objstream.Read
objstream.Close()
set objstream = nothing
'-----------------------关闭对象,释放资源-------------------------
'response.Write err.Description
End sub
function saveimage(from,tofile)
dim geturl,objStream,imgs
geturl=trim(from)
imgs=gethttppage(geturl)'取得图片的具休内容的过程
Set objStream = Server.CreateObject("ADODB.Stream")'建立ADODB.Stream对象,必须要ADO 2.5以上版本
objStream.Type =1'以二进制模式打开
objStream.Open
objstream.write imgs'将字符串内容写入缓冲
objstream.SaveToFile server.mappath(tofile),2'-将缓冲的内容写入文件
objstream.Close()'关闭对象
set objstream=nothing
end function
%>