三星应用商店搜不到:我用ASP做上传,图片上传上去了,可是不知道怎样让文字说明和图片一起上传,下面是程序???

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/07 06:22:22
<<<<<<<upload1.asp>>>>>>>>>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form" method="post" action="upfile1.asp" enctype="multipart/form-data" >
<tr>
<td><input type="hidden" name="act" value="upload" class=box><input type="hidden" name="filepath" value="upload" class=box>
<input type="file" name="file1" class=saveHistory>
<input type="submit" name="Submit" value="添加" class=INPUT01> </td>
</tr>
</form>
</table>

<<<<<<<<<<<<upfile1.asp>>>>>>>>>>>>>>>>>
<!--#include FILE="upload.inc"-->
<html>
<head>
<title>文件上传</title>
<style type="text/css">
a:link { font-size: 9pt; text-decoration: none; color: #000000}
a:visited { font-size: 9pt; text-decoration: none; color: #333333}
a:hover { font-size: 9pt; text-decoration: none;color: #FF6600}
body { font-size: 9pt }
td { font-size: 9pt }
.box { border: 1px solid #999999;}
</style>
</head>
<body>

<%
set upload=new upload_5xSoft ''建立上传对象

formPath=upload.form("filepath")
''在目录后加(/)
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,3))
ranNum=int(900*rnd)+100

filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt

if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
file.SaveAs Server.mappath(filename) ''保存文件
iCount=iCount+1
end if
set file=nothing
next
set upload=nothing

session("upface")="done"

response.write "图片已添加,请继续!如出错请<a href=../upfile/upload1.asp>点击这里</a>"

%>
<script >
parent.FORM.pa_logo.value='upfile/<%=filename %>'
</script>

<%

'--------将日期转化成文件名--------
function MakedownName(filename)
dim fname,Forumupload,u
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
Forum_upload="gif,jpeg,bmp"
Forumupload=split(Forum_upload,",")
for u=0 to ubound(Forumupload)
if instr(filename,Forumupload(u))>0 then
MakedownName=fname & "." & Forumupload(u)
exit for
end if
next
end function

%>
</body>
</html>