I have the code below UI with DropZone.
When submitbutton is clicked. I want to do the following.
- Validate extension to jpg and gif only
- Upload to directory c:\temp\
How can do that in Javascript?
function submit()
{
???
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Mvc4Application_Basic.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://raw.github.com/enyo/dropzone/master/downloads/dropzone.js"></script>
<link href="http://www.dropzonejs.com/css/general.css?v=7" rel="stylesheet" />
</head>
<body>
<form id="frmMain" runat="server" class="dropzone">
<div>
<div class="fallback">
<input name="file" type="file" multiple />
<a id="submitbutton" name="submitbutton" class="button special" onclick="submit()">Submit Now</a>
<a>
</div>
</div>
</form>
</body>
</html>
Open in new window