98 lines
3.6 KiB
Plaintext
98 lines
3.6 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Photo_upload2.aspx.cs" Inherits="Mtxfw.shop.Photo_upload0" %>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<title>无标题文档</title>
|
||
<script src="/Scripts/jquery-2.0.2.min.js" type="text/javascript"></script>
|
||
<style type="text/css">*{ margin:0;padding:0;}body{ background-color:#fff;}
|
||
body .uploadbox{ background-color:#fff;width:100px; height:32px; margin:10px auto; }
|
||
#uploadForm{ position: relative;
|
||
display: inline-block;width:100px; height:32px;
|
||
text-align:left;
|
||
line-height:32px;
|
||
border:1px solid #dfdfdf;
|
||
background-color:#13b60b;
|
||
text-indent:0px;
|
||
-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px 3px 3px 3px;
|
||
color:#fff;
|
||
font-size:16px;
|
||
font-weight:bold;
|
||
z-index:2;
|
||
text-indent:25px;
|
||
cursor:pointer;background:#b70202 url(/images/iconfont.png) 3px -136px no-repeat;}
|
||
#uploadForm input{position: absolute;width:100px; height:32px; left: 0; top: 0; opacity: 0; filter: alpha(opacity=0);}
|
||
|
||
|
||
|
||
</style>
|
||
<script type="text/javascript">
|
||
|
||
|
||
function imgUploading() {
|
||
var d = $(window.parent.document);
|
||
var tips = d.find("#showimage");
|
||
tips.html(tips.html() + "<li id='ajaxLoaderpic'><img src='/images/ajaxLoader.gif' /></li>");
|
||
d.find("#IFUpload").val(1);
|
||
var formData = new FormData($("#uploadFormdata")[0]);
|
||
$.ajax({
|
||
url: '/Ajax.ashx',
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function (returndata) {
|
||
var imgurl = returndata;
|
||
if (imgurl != "") {
|
||
var d = $(window.parent.document);
|
||
var tips = d.find("#showimage");
|
||
var IFUpload = d.find("#IFUpload");
|
||
if (imgurl == "0") {
|
||
alert("上传格式不正确,只能上传图片文件");
|
||
tips.find("#ajaxLoaderpic").hide(300);
|
||
}
|
||
else if (imgurl == "1") {
|
||
alert("上传图片太大,只能上传小于3M的文件!");
|
||
tips.find("#ajaxLoaderpic").hide(300);
|
||
}
|
||
|
||
else {
|
||
|
||
var apic = imgurl.split("|");
|
||
tips.html(tips.html().replace("<li id='ajaxLoaderpic'><img src='/images/ajaxLoader.gif' /></li>", ""));
|
||
var strimgurl = tips.html();
|
||
d.find("#uploadpic").val(apic[0]);
|
||
strimgurl = "<li><img src='" + apic[0] + "' /></li>";
|
||
tips.html(strimgurl);
|
||
tips.find("#ajaxLoaderpic").hide(300);
|
||
}
|
||
IFUpload.val(0);
|
||
|
||
}
|
||
},
|
||
error: function (returndata) {
|
||
alert(returndata);
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
</script>
|
||
</head>
|
||
|
||
<body>
|
||
<p>
|
||
<div class="uploadbox">
|
||
<div id="uploadForm"><form id="uploadFormdata" target="_self">
|
||
上传图片<input name="Photo" id="Photo" onChange="imgUploading();" type="file" accept="image/*" /><input name="hidyanse" id="hidyanse" type="hidden" value="" />
|
||
<input name="hidphotos" id="hidphotos" type="hidden" value="" /><input type="hidden" name="action" value="UploadPicture" />
|
||
</form></div>
|
||
</div>
|
||
|
||
</body>
|
||
</html>
|