diff --git a/example/file_input.html b/example/file_input.html
new file mode 100644
index 0000000..3c70071
--- /dev/null
+++ b/example/file_input.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/file_input.js b/example/file_input.js
new file mode 100644
index 0000000..720e00b
--- /dev/null
+++ b/example/file_input.js
@@ -0,0 +1,75 @@
+$(function() {
+ var App = {
+ init: function() {
+ App.attachListeners();
+ },
+ config: {
+ reader: "code_39",
+ length: 10
+ },
+ attachListeners: function() {
+ $(".controls input[type=file]").on("change", function(e) {
+ if (e.target.files && e.target.files.length) {
+ App.decode(URL.createObjectURL(e.target.files[0]));
+ }
+ });
+
+ $(".controls .reader-group").on("change", "input", function(e) {
+ e.preventDefault();
+ App.detachListeners();
+ App.config.reader = e.target.value;
+ App.init();
+ });
+ },
+ detachListeners: function() {
+ $(".controls input[type=file]").off("change");
+ $(".controls .reader-group").off("change", "input");
+ },
+ decode: function(src) {
+ Quagga.decodeSingle({
+ decoder: {
+ readers : [App.config.reader + '_reader']
+ },
+ locate : true,
+ src : src
+ }, function(result) {});
+ }
+ };
+
+ App.init();
+
+ Quagga.onProcessed(function(result) {
+ var drawingCtx = Quagga.canvas.ctx.overlay,
+ drawingCanvas = Quagga.canvas.dom.overlay;
+
+ if (result) {
+ if (result.boxes) {
+ drawingCtx.clearRect(0, 0, parseInt(drawingCanvas.getAttribute("width")), parseInt(drawingCanvas.getAttribute("height")));
+ result.boxes.filter(function (box) {
+ return box !== result.box;
+ }).forEach(function (box) {
+ Quagga.ImageDebug.drawPath(box, {x: 0, y: 1}, drawingCtx, {color: "green", lineWidth: 2});
+ });
+ }
+
+ if (result.box) {
+ Quagga.ImageDebug.drawPath(result.box, {x: 0, y: 1}, drawingCtx, {color: "#00F", lineWidth: 2});
+ }
+
+ if (result.codeResult && result.codeResult.code) {
+ Quagga.ImageDebug.drawPath(result.line, {x: 'x', y: 'y'}, drawingCtx, {color: 'red', lineWidth: 3});
+ }
+ }
+ });
+
+ Quagga.onDetected(function(result) {
+ var code = result.codeResult.code,
+ $node,
+ canvas = Quagga.canvas.dom.image;
+
+ $node = $(' ');
+ $node.find("img").attr("src", canvas.toDataURL());
+ $node.find("h4.code").html(code);
+ $("#result_strip ul.thumbnails").prepend($node);
+ });
+});
\ No newline at end of file