For completeness, the OP does not state he is looking to do this in a browser (if he is, as has been stated, it is generally not possible)
However javascript per se does allow this; it can be done with server side javascript.
See this documentation on the Javascript File class
Edit: That link was to the Sun docs that now have been moved by Oracle.
To keep up with the times here’s the node.js documentation for the FileSystem class: http://nodejs.org/docs/latest/api/fs.html
Edit(2): You can read files client side now with HTML5: http://www.html5rocks.com/en/tutorials/file/dndfiles/
Related Posts:
- How to read a local text file?
- How to read a local text file?
- How do you use the ? : (conditional) operator in JavaScript?
- Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai
- Creating multiline strings in JavaScript
- How to make a word underline in Markdown
- JQuery – $ is not defined
- Is it possible to sandbox JavaScript running in the browser?
- RegEx Ignore Case
- What is the convention in JSON for empty vs. null?
- Generating random whole numbers in JavaScript in a specific range?
- Better way to sum a property value in an array
- Javascript require() function giving ReferenceError: require is not defined
- jQuery AJAX cross domain
- How to extract extension from filename string in Javascript?
- keep getting “? Something is already running on port 3000” when I do npm start on react app
- React Context vs React Redux, when should I use each one?
- Regular expression : match either of two conditions?
- How to remove text from a string?
- Convert character to ASCII code in JavaScript
- Disable same origin policy in Chrome
- How do I remove a key from a JavaScript object?
- What is causing the error `string.split is not a function`?
- Difference between innerText, innerHTML and value?
- Uncaught TypeError: data.push is not a function
- Length of a JavaScript object
- Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode
- Module not found: Error: Can’t resolve ‘fs’ in
- TypeError: $(…).modal is not a function with bootstrap Modal
- How to do fade-in and fade-out with JavaScript and CSS
- I want to remove double quotes from a String
- Calculating median – javascript
- Vue is not defined
- How to remove all listeners in an element?
- How do I check if an object has a key in JavaScript?
- How to add a “readonly” attribute to an ?
- npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Nuwanst\package.json’
- How to change value of object which is inside an array using JavaScript or jQuery?
- How to detect pressing Enter on keyboard using jQuery?
- How to make your Discord Bot always active
- How to write inside a DIV box with javascript
- use Lodash to sort array of object by value
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- How to make an HTML back link?
- How to fix getImageData() error The canvas has been tainted by cross-origin data?
- How to make fadeOut effect with pure JavaScript
- How to get unique values in an array
- How to fix Error: listen EADDRINUSE while using NodeJS?
- What is ‘xmlhttp.setRequestHeader();’ and in which situations is it used?
- Write / add data in JSON file using Node.js
- Set scroll position
- .filter is not a function
- Function overloading in Javascript – Best practices
- Wait until flag=true
- momentJS date string add 5 days
- When is a CDATA section necessary within a script tag?
- How to get scrollbar position with Javascript?
- where is create-react-app webpack config and files?
- “You may need an appropriate loader to handle this file type” with Webpack and Babel
- Adding javascript to child theme
- What does l10n.js do in WordPress 3.1? And how do I remove it?
- How to add javascript just before the closing body tag in the footer of WordPress
- Open media frame and select an attachment
- wp_localize_script with boolean and init
- Loading Javascript Only When Specific Content Existing in a Post?
- How to pre-fill Google Forms URLs with logged-in WordPress user’s data
- Use of Javascript with Dojo/Dijit on a WordPress page
- WordPress loads whole jQuery UI library
- Javascript that will execute on only child pages of a specific parent
- What is the Javascript event for an item being added to the cart in Woocommerce?
- How do I embed a Javascript form directly into a page?
- Can the index.asset.php file be used with the enqueue_block_editor_assets action?
- Using wp.data.select get actual tags (not id’s) used in post
- JavaScript && operator in visual editor
- How to deal with the confliction between PHP-Markdown and MathJax?
- Programatically update posts in database from one block to another using transform
- Mouse wheel Auto scroll to anchor [closed]
- Adding inline JavaScript encoding issue
- a child theme not de-registering a patent javascript file
- Custom Gutenberg-Block esnext pass variables
- How to read inline-CSS from Gutenberg block?
- javascript not loading
- Using javascript on my site to create nested tabs
- How does WP determine the difference between a post and a page url
- creating a static HTML/JS/PHP page
- Newest version of javascript
- wp_enqueue_script does not recognize my js file?
- create timestamp links to jump to specific times on rumble videos
- Save in localstorage and db and show it later
- script not working anymore after saving widget settings
- Loading two versions of same JS libary
- Error handling for wpdb error – displaying an error message to the user
- Load Particles.js into WordPress Website
- load-scripts.php loads incorrect file names
- JS enqueue path (localhost)
- WordPress Theme – jQuery JavaScript Library Issue
- Script loaders vs wp_enqueue_script
- Don’t understand how to link Javascript files in WordPress
- Uncaught ReferenceError: tippy is not defined