用最简单的语句写一个上传图片代码上传到一个指定文件夹里.docxVIP

  • 16
  • 0
  • 约9.84千字
  • 约 13页
  • 2017-08-20 发布于北京
  • 举报

用最简单的语句写一个上传图片代码上传到一个指定文件夹里.docx

upfile.asp 上传的图片存到images/upfile文件夹下。!--#include FILE=upfile--meta http-equiv=Content-Type content=text/html; charset=iso-8859-1%if Request(menu)=up thenOn Error Resume NextSet upl = Server.CreateObject(SoftArtisans.FileUp)If -2147221005 = Err Thenset FileUP=new Upload_file FileUP.GetDate(-1)formPath=images/upfile/set file=FileUP.file(file)filename=formPathyear(now)month(now)day(now)hour(now)minute(now)second(now).file.FileExtselect case LCase(file.FileExt)case gifimg=[img]cluburl/filename[/img]case jpgimg=[img]cluburl/filename[/img]case swfimg=[flash]cluburl/filename[/flash]case elseerror2(Sorry ,this local server only supports GIF , JPG and SWF format of files\n does not support file.FileExt format of files)end selectfile.SaveToFile Server.mappath(filename)set FileUP=nothingelsefilename=year(date)month(date)day(date)hour(time)minute(time)second(time)select case upl.ContentTypecase application/octet-streamerror2(Unknown file format!)case image/giftypes=gifcase image/pjpegtypes=jpgcase application/x-shockwave-flashtypes=swfend selectfilename=images/upfile/filename.typesif types=gif or types=jpg thenimg=[img]cluburl/filename[/img]elseif types=swf thenimg=[flash]cluburl/filename[/flash]elseerror2(Sorry ,this local server only supports GIF , JPG and SWF format of files\n does not support upl.ContentTypeformat of files)end ifupl.SaveAs Server.mappath(filename)set upl=nothingEnd Ifresponse.write SCRIPTparent.myform.pic.value=admin/filename/SCRIPTresponseendelse%body topmargin=0table cellpadding=0 cellspacing=0 width=100% height=20form enctype=multipart/form-data method=post action=upfile.asp?menu=uptrtdinput type=file style=FONT-SIZE:9pt name=file size=2 input style=FONT-SIZE:9pt type=submit value=Upload name=Submit/td/tr/form/table%end if%评论(2)?|?25?0mngenius?|?十二级?采纳率43%擅长:?汇编语言?其他编程语言?数据库DB其他类似问题2008-03-05用简单的ASP语句把图片上传到服务器指定的文件夹2012-03-22寻找一个asp上传图片的代码,并记录图片名称。如果有文件并且可以直...?12008-12-12用纯ASP代码实现图片上传到指定文件夹并存入数据库中的代码。谁有呀...?132010-07-31求ASP上传图片代码(上传图片到指定文件夹,同时获取路径

文档评论(0)

1亿VIP精品文档

相关文档