Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
30_09_2024
:
bidule.html
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<!DOCTYPE html> <html> <head> <style> .filenameupload { width: 98%; } #upload_prev { border: thin solid #000; width: 65%; padding: 0.5em 1em 1.5em 1em; } #upload_prev span { display: flex; padding: 0 5px; font-size: 12px; } </style> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="file_count"></div> <input type="file" id="uploadFile" name="FileUpload" multiple="multiple" /> <div id="upload_prev"></div> <script type="text/javascript"> var fileCount = 0; var showFileCount = function() { $('#file_count').text('# Files selected: ' + fileCount); }; showFileCount(); $(document).on('click', '.close', function() { $(this).parents('span').remove(); fileCount -= 1; showFileCount(); }) $('#uploadFile').on('change', function() { var filename = this.value; var lastIndex = filename.lastIndexOf("\\"); if (lastIndex >= 0) { filename = filename.substring(lastIndex + 1); } var files = $('#uploadFile')[0].files; for (var i = 0; i < files.length; i++) { $("#upload_prev").append('<span>' + '<div class="filenameupload">' + files[i].name + ' abc</div>' + '<p class="close" >X</p></span>'); } fileCount += files.length; showFileCount(); }); </script> </body> </html>