关于图片问题!

hsdly 2003-08-20 06:56:32
我想把本地计算机内的图片,传到网页上并在网页上可以预览,最后提交以后存放到数据库中,通过浏览页面可以显示图片
...全文
98 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hsdly 2003-08-26
  • 打赏
  • 举报
回复
您能说得更清楚一些吗!
hsdly 2003-08-26
  • 打赏
  • 举报
回复
gz
netnight 2003-08-21
  • 打赏
  • 举报
回复
就是图片到目录的上传方式
在数据库结构中加个字段:pic(字符型)
用来保存图片路径,显示时就是如 hsdly() 所说
'upload_5xSoft'
是稻香老农的 存图片存数据库时用到的类,好像存目录用不到它吧

hsdly 2003-08-21
  • 打赏
  • 举报
回复
GZ
hsdly 2003-08-21
  • 打赏
  • 举报
回复
你说的这种方法,好像是.net的吧!没有'upload_5xSoft' 这个类
melted 2003-08-20
  • 打赏
  • 举报
回复
在ACCESS表里建一个PIC1栏目!
然后去调用!
<img src=<%=rs1("pic1")%> border="1" class="img" width="146" height="161" >
melted 2003-08-20
  • 打赏
  • 举报
回复
<%
session.Timeout = 50
' set timeout in Minute
loginstatus = session("login")
loginname = session("name")

if loginstatus = "yes" and loginname=session("k666") then
%>
<!--#include FILE="upload.inc"-->
<html>
<head>
<title>文件上传</title>
<style type="text/css">
<!--
body {
font-size: 12px;
color: #0D498C;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor=#ffffff topmargin="0" >
<%
dim upload,file,formName,formPath,iCount,filename,fileExt
set upload=new upload_5xSoft ''建立上传对象



formPath="Pic"

''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"

iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.filesize<100 then
response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if

if file.filesize>1000000 then
response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if

fileExt=lcase(right(file.filename,4))

if fileEXT<>".gif" and fileEXT<>".jpg" then
response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>"
response.end
end if

filename=file.FileName
savefile=formPath+filename
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(savefile) ''保存文件
response.write"图片路径:"
response.write"<input type=text name=bannerpath value="& ulpath &""& formPath&File.FileName&">"
response.write" 请把路径拷到下面的图片路径框内"

end if
set file=nothing
iCount=iCount+1
next
set upload=nothing ''删除此对象

%>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧