0% found this document useful (0 votes)
17 views

Upload File in MVC Using Jquery

mvc html5
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Upload File in MVC Using Jquery

mvc html5
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--------------------------------------------------------------------------------------------------write in ext.

js some local file


$(document).ready(function() {
$(#'add_more').click(function(){
var current_count = $('input[type="file"]').lenght;
//alert(current_count);
var next_count = current_count +1;
$('#file_upload').prepend('<p><input type="file" name="file_"+next_count+'"/
></p>);
});
});
---------------------------------------------------------------------------------------------------in main file
<!doctype html>
<html lang=en">
<head>
<meta charset="utf-8">
<title>upload files</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<form id="file_upload" action="#" method="get"enctype="multipart/form
-data">
<p><input type="file" name="file_1"/></p>
<p>
<input type="submit" value=Upload"/>
<a id="add_more" href="#">Add more</a>
</p>
</form>
<script type="text/javascript" src=js/jquery.js"></script>
<script type="text/javascript" src=js/ext.js"></script>
</body>
</html>

You might also like