CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

关于图片上传的问题,在线等待!

楼主zjh0993(天上的鱼)2004-03-01 14:44:54 在 Web 开发 / ASP 提问

<%@   TRANSACTION   =   Required   %>  
  <!--#include   virtual="/include/conn.asp"-->  
  <%  
  On   Error   Resume   Next  
  server.ScriptTimeout="9000000"  
   
  Set   Upload   =   Server.CreateObject("Persits.Upload")  
  Upload.SetMaxSize   10000000,   True    
   
  Upload.ProgressID   =   Request.QueryString("PID")  
  sUrl.FilePath=server.MapPath("/ADPic")&"/PicSource"  
  'sUrl="E:\UploadFile\"  
   
  '   Save   to   memory.   Path   parameter   is   omitted  
  Upload.Save  
   
  strFileName=gen_key(10)  
  '   Check   whether   a   file   was   selected  
  Set   File   =   Upload.Files("txtFilePath")  
  If   Not   File   Is   Nothing   Then        
        FilePath=strFileName   &   File.Ext  
        File.SaveAs   sUrl   &   txtFilePath  
  End   If  
   
  'Upload.Save   sUrl  
  PicID=Upload.Form("txtPicID")  
  PicWidth=Upload.Form("txtPicWidth")  
  PicHeight=Upload.Form("txtPicHeight")  
   
  'Response.Write   "FilmName:"   &   FilmName   &   "<br>"  
  'Response.Write   "FilePath:"   &   FilePath   &   "<br>"  
   
  'Response.Write   "UserID:"   &   UserID   &   "<br>"  
  'Response.Write   "Dec:"   &   FilmDec   &   "<br>"  
   
  'Response.Write   "sUrl:"   &   sUrl   &   "<br>"  
  StrSql="update   PicSource   set   FilePath='"&FilePath&"',PicWidth='"&PicWidth&"',PicHeight='"&PicHeight&"',   Status='0'   where   PicID='"&PicID&"'"  
  'Response.Write   "StrSql:"   &   StrSql   &   "<br>"  
  'Response.End    
  conn.execute(StrSql)  
   
  if   Err   then    
  ObjectContext.SetAbort  
  else    
  ObjectContext.SetComplete  
  end   if    
   
  Sub   OnTransactionAbort  
  ShowAlert("上传失败!")  
  End   Sub  
  Sub   OnTransactionCommit  
  ShowAlert("上传成功!")  
  End   Sub  
   
   
  function   ShowAlert(Message)  
  Response.Write("<script   language='javascript'>")  
  Response.Write("alert('"&Message&"');")  
  Response.Write("parent.close();")  
  'Response.Write("location.href='frmUploadPic.asp';")  
  Response.Write   ("</script>")  
  end   function  
   
  Function   gen_key(digits)  
  'Create   and   define   array  
  dim   char_array(50)  
  char_array(0)   =   "0"  
  char_array(1)   =   "1"  
  char_array(2)   =   "2"  
  char_array(3)   =   "3"  
  char_array(4)   =   "4"  
  char_array(5)   =   "5"  
  char_array(6)   =   "6"  
  char_array(7)   =   "7"  
  char_array(8)   =   "8"  
  char_array(9)   =   "9"  
  char_array(10)   =   "A"  
  char_array(11)   =   "B"  
  char_array(12)   =   "C"  
  char_array(13)   =   "D"  
  char_array(14)   =   "E"  
  char_array(15)   =   "F"  
  char_array(16)   =   "G"  
  char_array(17)   =   "H"  
  char_array(18)   =   "I"  
  char_array(19)   =   "J"  
  char_array(20)   =   "K"  
  char_array(21)   =   "L"  
  char_array(22)   =   "M"  
  char_array(23)   =   "N"  
  char_array(24)   =   "O"  
  char_array(25)   =   "P"  
  char_array(26)   =   "Q"  
  char_array(27)   =   "R"  
  char_array(28)   =   "S"  
  char_array(29)   =   "T"  
  char_array(30)   =   "U"  
  char_array(31)   =   "V"  
  char_array(32)   =   "W"  
  char_array(33)   =   "X"  
  char_array(34)   =   "Y"  
  char_array(35)   =   "Z"  
   
  'Initiate   randomize   method   for   default   seeding  
  randomize  
   
  'Loop   through   and   create   the   output   based   on   the   the   variable   passed   to  
  'the   function   for   the   length   of   the   key.  
  do   while   len(output)   <   digits  
  num   =   char_array(Int((35   -   0   +   1)   *   Rnd   +   0))  
  output   =   output   +   num  
  loop  
   
  'Set   return  
  gen_key   =   output  
  End   Function  
  %>  
  <link   href="/css/mainTag.css"   type="text/css"   rel="stylesheet">  
  <BODY>  
  </body>  
   
  为什么我上传图片的时候总是说上传失败?不知道哪位高手可以告诉我? 问题点数:0、回复次数:0Top

相关问题

  • 在线等待,关于图片上传和显示的问题............
  • 图片预览,在线等待
  • 求助图片问题!!!在线等待!!
  • 图片插入问题(在线等待!!!)
  • 如何实现BBS中的图片上传功能(急,在线等待)
  • 如何利用JSP实现上传图片。在线等待。高分
  • 怎么把图片保存到数据库中?(在线等待)
  • 请高手灌水,图片的亮度调整,在线等待
  • 寻求淡入淡出图片的BCB源码!在线等待!
  • 菜鸟问题.图片按钮如何实现.在线等待.

关键词

得分解答快速导航

  • 帖主:zjh0993

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo