This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form" name="form" action="/uploader" enctype="multipart/form-data" method="post"> | |
<input name="files" type="file" multiple /> | |
<button type="submit">Submit</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form" name="form" action="/uploader" enctype="multipart/form-data" method="post"> | |
<input name="files" type="file" multiple onchange="submitForm('form');" /> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function submitForm(formId) { | |
document.getElementById(formId).submit(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="upload-button"> | |
<div class="label">Click me!</div> | |
<input id="files" name="files" type="file" size="1" multiple onchange="uploadFiles('files');" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.upload-button { | |
background: #f0f0f0; | |
border-radius: 100px; | |
text-align: center; | |
position: relative; | |
width: 200px; | |
height: 200px; | |
} | |
.upload-button .label { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe src="/home/iframe" frameborder="0" marginwidth="0" marginheight="0" width="400" height="200" scrolling="no"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form" name="form" action="/uploader" enctype="multipart/form-data" method="post"> | |
<div class="buttons"> | |
<div class="upload-button"> | |
<div class="label">Click me!</div> | |
<input id="files" name="files" type="file" size="1" multiple onchange="uploadFiles('files');" /> | |
</div> | |
</div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uploadFiles(inputId) { | |
var input = document.getElementById(inputId); | |
var files = input.files; | |
var formData = new FormData(); | |
for (var i = 0; i != files.length; i++) { | |
formData.append("files", files[i]); | |
} | |
$.ajax( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="dragAndDropArea" class="drag-and-drop-area"> | |
Drag and drop a file into this area | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initializeDragAndDropArea() { | |
if (typeof (window["FileReader"]) == "undefined") { | |
return; | |
} | |
var dragAndDropArea = $("#dragAndDropArea"); | |
if (dragAndDropArea.length == 0) { | |
return; | |
} |
OlderNewer