像这样的要怎么写代码?我不会写啊,请高手帮忙啊
ASP怎么上传头像直显示同一个页面
- 提问者网友:遁入空寂
- 2021-07-24 17:23
- 五星知识达人网友:轻熟杀无赦
- 2021-07-24 18:52
filename=now()
filename=replace(filename,"-","")
filename=replace(filename,":","")
filename=replace(filename," ","")
filename=filename
end function
'----------------------------------------------------------
'-------------------------------------------------------------------
set upload=new upload_5xsoft
set upfile=upload.file("files")
title=upload.form("t1")
info=upload.form("t2")
if upfile.filesize>0 and upfile.filename<>"" then
if instr("jpg,bmp,gif",getextendname(upfile.filename))>0 then
if upfile.filesize<204800 then
fname=filename&"."&getextendname(upfile.filename)
upfile.saveas server.mappath("pic/"&fname)
sql="insert into img (title,info,imgpath)values('"+ title +"','"+ info +"','"+ fname +"')"
conn.Execute sql
conn.close
response.write "<script>alert('添加图片成功!');top.location.href='index.asp';</script>"
else
response.write "<script language='javascript'> alert('文件上传失败,大小超过了200K!');history.back(); </script>"
end if
else
response.write "<script language='javascript'> alert('文件上传失败,其不为图片格式!');history.back(); </script>"
end if
end if
- 1楼网友:白昼之月
- 2021-07-24 21:02
我记得ASP有个控件吧,直接拖拉上去就行了啊,还要什么代码咯
有个专门传图片的控件~~~~~~
- 2楼网友:你哪知我潦倒为你
- 2021-07-24 20:29
xianshi显示什么啊?
你这个现实的样子是 未知图片的样子啊?