bgrins / filereader.js

A lightweight wrapper for the JavaScript FileReader interface
http://bgrins.github.com/filereader.js/
MIT License
413 stars 86 forks source link

Only executes the second time #18

Closed miltonmagalhaes closed 9 years ago

miltonmagalhaes commented 9 years ago

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Untitled Document
bgrins commented 9 years ago

Can you provide a test case and more information about how to reproduce the problem?

miltonmagalhaes commented 9 years ago

this is the example.

bgrins commented 9 years ago

this is the example.

I don't understand - I just see a doctype in your initial comment

miltonmagalhaes commented 9 years ago

Brian

The code of filereader.js execute only the second time. In the first time don't execute.

Date: Sat, 10 Jan 2015 18:29:03 -0800 From: notifications@github.com To: filereader.js@noreply.github.com CC: miltonmagalhaes@hotmail.com Subject: Re: [filereader.js] Only executes the second time (#18)

this is the example.

I don't understand - I just see a doctype in your initial comment

— Reply to this email directly or view it on GitHub.

                  =
bgrins commented 9 years ago

I don't see this problem on https://bgrins.github.io/filereader.js/. Can you provide a test case (like on jsfiddle) that demonstrates this problem? The description of the problem is not clear, and provides no additional steps to reproduce it.

miltonmagalhaes commented 9 years ago

http://jsfiddle.net/h3e0dgt8/

Date: Mon, 12 Jan 2015 08:46:11 -0800 From: notifications@github.com To: filereader.js@noreply.github.com CC: miltonmagalhaes@hotmail.com Subject: Re: [filereader.js] Only executes the second time (#18)

I don't see this problem on https://bgrins.github.io/filereader.js/. Can you provide a test case (like on jsfiddle) that demonstrates this problem? The description of the problem is not clear, and provides no additional steps to reproduce it.

— Reply to this email directly or view it on GitHub.

                  =
bgrins commented 9 years ago

You need to call FileReaderJS.setupInput immediately and only once (before waiting for the onchange event on the input).

So call FileReaderJS.setupInput in DOM ready, then it should work as you are wanting.

miltonmagalhaes commented 9 years ago

You can send me a example

Date: Mon, 12 Jan 2015 10:36:54 -0800 From: notifications@github.com To: filereader.js@noreply.github.com CC: miltonmagalhaes@hotmail.com Subject: Re: [filereader.js] Only executes the second time (#18)

You need to call FileReaderJS.setupInput immediately and only once (before waiting for the onchange event on the input).

So call FileReaderJS.setupInput in DOM ready, then it should work as you are wanting.

— Reply to this email directly or view it on GitHub.

                  =
bgrins commented 9 years ago

This example is linked to from the home page and should work how you are expecting: http://jsfiddle.net/bgrins/nWP59/. All you should have to do is switch setupDrop to setupInput.

miltonmagalhaes commented 9 years ago

You don't undestand. I need a example about your comment:

You need to call FileReaderJS.setupInput immediately and only once (before waiting for the onchange event on the input).

So call FileReaderJS.setupInput in DOM ready, then it should work as you are wanting.

Date: Mon, 12 Jan 2015 10:57:33 -0800 From: notifications@github.com To: filereader.js@noreply.github.com CC: miltonmagalhaes@hotmail.com Subject: Re: [filereader.js] Only executes the second time (#18)

This example is linked to from the home page and should work how you are expecting: http://jsfiddle.net/bgrins/nWP59/. All you should have to do is switch setupDrop to setupInput.

— Reply to this email directly or view it on GitHub.

                  =
bgrins commented 9 years ago

The example I sent is exactly what you will need to do, it just needs a very minor change (add an <input type="file" /> to the page and change the call from setupDrop to setupInput)

miltonmagalhaes commented 9 years ago

Sorry, but don't work See.

I'm sorry, but does not work the only example replacing. My problem: Read more from PDF files and identify if they were generated in version 1.4. Each reading should return true or false. For example: if (IsFilePdf14 (File [i])) {} else {} alert: I run in Firefox

Date: Mon, 12 Jan 2015 11:51:25 -0800 From: notifications@github.com To: filereader.js@noreply.github.com CC: miltonmagalhaes@hotmail.com Subject: Re: [filereader.js] Only executes the second time (#18)

The example I sent is exactly what you will need to do, it just needs a very minor change (add an to the page and change the call from setupDrop to setupInput)

— Reply to this email directly or view it on GitHub.

                  =