I have successfully implemented dropzone.js on my ASP.MVC 4. But I need to shorten the height of the dropdown area and translate the texts. Is there any easy way to do so? I tried to modify the CSS with no results; the dropdown area still takes the same height.
Finally got my own answer:
<html>
<head >
<meta name="viewport" content="width=device-width" />
<title>Index2</title>
<script src="/media/dropzone.js"></script>
<link href="~/Media/css/basic.css" rel="stylesheet" />
<link href="~/Media/css/dropzone.css" rel="stylesheet" />
</head>
<body>
<style>
.dropzone-previews {
height: 200px;
width: 500px;
border: dashed 1px red;
background-color: lightblue;
}
</style>
<div id="previews" class="dropzone-previews"></div>
<button id="clickable">Click me to select files</button>
<script>
new Dropzone("div#previews", { // Make the whole body a dropzone
url: "/home/fileUpload", // Set the url
previewsContainer: "#previews", // Define the container to display the previews
clickable: "#clickable", // Define the element that should be used as click trigger to select files.
maxFiles:5,
acceptedFiles:"image/*,application/pdf"
});
</script>
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With