Introduction
This is a simple article for beginners developing with HTML 5 that helps to understand how to upload a file in a browser using HTML 5 tools. We know that HTML is the client-side scripting language that helps display the data in a browser. We know that HTML is an acronym for "HyperText Markup Language" used to display data in a browser. HTML 5 is the advanced version of HTML. HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. HTML 5 is the advanced version of HTML used to develop 3D or multimedia applications.
Step 1: First open an HTML editor such as Visual Studio.
- Open start->Notepad.
- The name of the editor is "Michael."

- Right-click on desktop.
- new->add folder.

Step 3: Open Visual Studio.
- Go to file -> New->Projects.
- Create an ASP. NET Web Application.
- Name of "File.aspx".


Step 4: Add an HTML file to your web application.
- Right-click of Solution Explorer.
- Add->add new item->HTML form.
- Name of HTML form is "File.html"


Step 5: Set the script browser a data on a File.
Code
- <script>
- document.querySelector('input[type="file"]').addEventListener('change', function(e) {
- var files = this.files;
- loadInlineEffort('#fileListEffort', function(Effort) {
- Effort.onmessage = function(e) {
- console.log(e.data);
- };
- for (var i = 0, file; file = files[i]; ++i) {
- var CTX = new FileCTX();
- CTX.onload = function(e) {
- console.log(this.result);
- };
- CTX.onerror = function(e) {
- console.log(e);
- };
- CTX.readAsArrayBuffer(file);
- }
- };
- }, false);
- function loadInlineEffort(selector, callback) {
- Win.URL =Win.URL ||Win.webkitURL || null;
- Win.BlobBuilder =Win.WebKitBlobBuilder ||
- Win.MozBlobBuilder ||Win.BlobBuilder;
- var script = document.querySelector(selector);
- if (script.type === 'javascript/Effort') {
- var bb = new BlobBuilder();
- bb.append(script.textContent);
- callback(new Effort(window.URL.createObjectURL(bb.getBlob()));
- }
- }
- </script>
Step 6: Set the functionality Fetching the entries of a File.



Join the conversation! Your thoughts help the community grow.