-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload_csv_file.php
26 lines (22 loc) · 934 Bytes
/
upload_csv_file.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
<form action="<?php echo URL::to_route('UserFile'); ?>" method="post" enctype="multipart/form-data" id="upload" style="display: none" >
<input type="file" name="user" id="user" style="display: none" onselect=""/>
<label for="" id="up" style="float: right">ClickHere To Add Bulk Lawyers</label>
</form>
<script>
var fl = document.getElementById('user');
fl.onchange = function(){
var ext = this.value.match(/\.(.+)$/)[1];
switch(ext)
{
case 'csv':
$('#upload').submit();
break;
default:
alert('Upload only .csv file');
this.value='';
}
};
$('#up').click(function(){
$('#user').click();
});
</script>