-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_form.php
More file actions
97 lines (83 loc) · 2.11 KB
/
upload_form.php
File metadata and controls
97 lines (83 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<html>
<head>
<title>Ajax File Uploader Plugin For Jquery</title>
<link href="ajaxfileupload.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/js/jquery-1.9.2.min.js"></script-->
<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
<script type="text/javascript">
function ajaxFileUpload()
{
$("#loading")
.ajaxStart(function(){
$(this).show();
})
.ajaxComplete(function(){
$(this).hide();
});
$.ajaxFileUpload(
{
url:'/home/account/upload/doajaxfileupload.php',
secureuri:false,
fileElementId:'fileToUpload',
dataType: 'json',
data:{name:'logan', id:'id'},
success: function (data, status)
{
if(typeof(data.error) != 'undefined')
{
if(data.error != '')
{
alert(data.error);
} else
{
alert(data.msg);
$('#ajaxreturn').html(data.msg);
}
}
},
error: function (data, status, e)
{
alert(e);
}
}
)
return false;
}
</script>
<!--/head>
<body>
<div id="wrapper">
<img id="loading" src="/images/loading.gif" style="display:none;">
<table cellpadding="0" cellspacing="0" class="tableForm">
<form name="form" id="uploadform" action="" method="POST" enctype="multipart/form-data">
<tr>
<th>Please select a file and click Upload button</th>
</tr>
<tr>
<td><input id="fileToUpload" type="file" size="45" name="fileToUpload" class="input" /></td> </tr>
<tr>
<!--td><input type="submit" id="uploadnow" name="Submitx" /></td>
<td><input type="submit" class="modalInput" id="uploadnow" name="Submit" /></td-->
<td><input type="button" class="modalInput" id="submitit" name="submit" value="Submit" /></td>
</tr>
</form>
<tr>
<td id="ajaxreturn">return area</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#submitit').click(function(e){
e.preventDefault();
alert('here');
var upload = ajaxFileUpload();
});
$('#uploadform').submit(function(e){
e.preventDefault();
});
});
</script>
</body>
</html>
<?php exit;?>