87,991
社区成员
发帖
与我相关
我的任务
分享<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<link href="../js/jquery.uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery.uploadify/jquery.uploadify-3.1.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(function () {
inituploadcontrol();
});
function inituploadcontrol() {
$('#file_upload').uploadify({
method: 'post',
formData: { 'uploadmp3': 'mp3' },
swf: '../js/jquery.uploadify/uploadify.swf',
uploader: '../Files/FileUpload.ashx',
cancelImg: '../js/jquery.uploadify/uploadify-cancel.png',
fileTypeDesc: 'mp3',
fileTypeExts: '*.mp3',
fileSizeLimit: '3.8MB',
buttonImage: '../images/server_go.png',
hideButton: true,
width: 16,
height: 16,
debug:true,
onUploadStart: function (file) {
$('#div1loading').show();
},
onUploadSuccess: function (file, data, response) {
$('#div1loading').hide();
var resultdata = jQuery.parseJSON(data);
if (resultdata.result == 'ok') {
//建立一条数据
addcontentbyvalue(resultdata.filemappingid, file.name);
}
else {
showErr(resultdata.message);
}
},
onUploadError: function (file, errorCode, errorMsg, errorString) {
$('#div1loading').hide();
}
});
}
function testclick() {
$('#file_upload').click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="file" name="file_upload" id="file_upload" />
<input id="manual2" type="button" onclick="testclick();" />
</form>
</body>
</html>$(function () {
inituploadcontrol();
});$(function () {
if(confirm("确认码?")){
inituploadcontrol();
}
});