Answers for "filereader"

5

java read file bufferedreader

try {
	File file = new File("data.txt");
	BufferedReader reader = new BufferedReader(new FileReader(file));
	String line;

	while((line = reader.readLine()) != null) {
	 	 System.out.println(line);
	}
} catch(IOException e) {
  	e.printStackTrace();
}
Posted by: Guest on June-22-2020
1

filereader javascript example

//HTML
<input type='file' accept='image/*' onchange='openFile(event)'><br>
<img id='output'>

//Javascript
var openFile = function(event) {
  var input = event.target;

  var reader = new FileReader();
  reader.onload = function(){
    var dataURL = reader.result;
    var output = document.getElementById('output');
    output.src = dataURL;
  };
  reader.readAsDataURL(input.files[0]);
}
Posted by: Guest on May-22-2020

Code answers related to "filereader"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language