风声无组件上传类[3]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 applebbs 的 blog

   else
    objform.add item&"_err",intferr
   end if
   if intferr<>0 then exit function
   if vartype(strfnam)=2 then
    select case strfnam
     case 0:strfnam=gettimestr()
      if strfext<>"" then strfnam=strfnam&"."&strfext
     case 1:strfnam=objform(item&"_name")
    end select
   end if
   binitem.type = 1
   binitem.open
   binform.position = objform(item&"_from")
   binform.copyto binitem,objform(item&"_size")
   binitem.savetofile server.mappath(p_savepath&strfnam),2
   binitem.close()
   if objform.exists(item) then
    objform(item)=strfnam
   else
    objform.add item,strfnam
   end if
   save=true
  end if
 end function

 public function getdata(item)
  getdata=""
  if objform.exists(item&"_from") then
   if getferr(objform(item&"_size"),objform(item&"_ext"))<>0 then exit function
   binform.position = objform(item&"_from")
   getdata=binformstream.read(objform(item&"_size"))
  end if
 end function

 public function form(item)
  if objform.exists(item) then
   form=objform(item)
  else
   form=""
  end if
 end function

 private function binval2(bin)
  dim lngvalue,i
  lngvalue = 0
  for i = lenb(bin) to 1 step -1
   lngvalue = lngvalue *256 + ascb(midb(bin,i,1))
  next
  binval2=lngvalue
 end function

 private function bin2val(bin)
  dim lngvalue,i
  lngvalue = 0
  for i = 1 to lenb(bin)
   lngvalue = lngvalue *256 + ascb(midb(bin,i,1))
  next
  bin2val=lngvalue
 end function

end class

本文关键:风声无组件上传类
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top