📄 upfile.asp
字号:
<!--#include file="../../inc/config.asp"-->
<%
dim filepath,fs
if request.QueryString("img")<>"" then
filepath=newspic&request.QueryString("img")
set fs=server.CreateObject("scripting.filesystemobject")
filepath=server.MapPath(filepath)
if fs.FileExists(filepath) then
fs.DeleteFile filepath,true
end if
end if%>
<html>
<head>
<title>商品图片上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #E8F1FF; color: #0000FF}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #000000}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="10">
<form name="form1" method="post" action="upfile.asp" enctype="multipart/form-data" onsubmit="checkImage('file1')">
<table width="560" border="1" cellspacing="0" cellpadding="5" align="center" bordercolordark="#6B8FC8" bordercolorlight="#ffffff">
<tr bgcolor="#CCCCCC">
<td height="22" align="left" valign="middle" bgcolor="#6B8FC8"><font color="#FFFFFF"> 请上传图片/</font>现在图片已经被删除请重新上传
</td>
</tr>
<tr align="center" valign="middle">
<td height="60" align="left" bgcolor="#E8F1FF"> <input type="hidden" name="filepath" value="/shop/shopimg/">
文件:
<input type="file" name="file1" style="width:400" class="tx1" value="">
<br>
</td>
</tr>
<tr align="center" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#eeeeee" height="24">
<input type="submit" name="Submit" value="提 交" class="bt">
<input type="reset" name="Submit2" value="清 除" class="bt">
</td>
</tr>
</table></form>
</body>
</html>
<script language=javascript>
function checkImage(sId)
{
if(( document.all[sId].value.indexOf(".gif") == -1) && (document.all[sId].value.indexOf(".jpg") == -1)) {
alert("请选择gif或jpg的图象文件");
event.returnValue = false;
}
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -