-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmove.php
42 lines (39 loc) · 1.21 KB
/
move.php
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test file uploading in csv to mysql</title>
</head>
<body>
<form id="upload_file">
<input type="file" name="upload" id="file_upload">
<input type="button" id="upload" value="upload">
</form>
<p class="msg"></p>
</body>
<?php
$route = "http://localhost/testing";
?>
<footer>
<script src="jquery.js"></script>
<script type="text/javascript">
$(document).on('click','#upload',function(){
var formData = new FormData();
formData.append('file', $('#file_upload')[0].files[0]);
$.ajax({
url: "<?php echo $route;?>/upload_pdo.php",
type: "post",
data: formData,
processData: false,
contentType: false,
beforeSend: function(){
$('.msg').html('Uploading....');
},
success : function(data) {
$('.msg').html('Upload Completed....');
}
})
});
</script>
</footer>
</html>