« Return to Thread: Transfering a file using DWR 3.0 disables the "input" events

Re: Transfering a file using DWR 3.0 disables the "input" events

by Lance Java :: Rate this Message:

Reply to Author | View in Thread

DWR's Jira can be found here
http://bugs.directwebremoting.org

2009/6/25 Antonio Cabrera <antoniocabreraperez@...>
Well, I think this can be considered an small "issue": Is there any way to "open" an issue in the DWR project?


From: Lance Java <lance.java@...>
DWR pollutes the file object attributes and changes it's name prior to
posting it so it clones it and swaps prior to doing a post. I guess we could
be smarter here and revert the original back to it's original state instead.

Hopefully there's a simple workaraound for your problem.

2009/6/18 Jose Noheda <jose.noheda@...>

> Yes, it's replaced by another input file
>
>
> On Thu, Jun 18, 2009 at 12:08 PM, Antonio Cabrera <
> antoniocabreraperez@...> wrote:
>
>> I'm using dojo (not really the problem) and the last DWR CVS version
>> (compiled on jun-18-2009)
>> Basically, I connect the "onchange" events of an "<input type="file" >"
>> and when the event is fired, I call a function that transfer the file to the
>> server.
>>
>> All works fine, (the callback function is executed)... but the input
>> doesn't fire the 'onchange' event anymore.
>>
>> The problem is common to Firefox, Chrome and IE.
>>
>> I'm not really sure if this is an Issue or is the correct behaviour.
>>
>> here you are an example of code:
>>
>> *HTML*:
>>
>> <input type="file" id="theFileInputId" />
>>
>>
>> *JAVASCRIPT*:
>>
>> constructor:function() {
>> var fileInput = dojo.byId("theFileInputId");
>> dojo.connect(fileInput, "onchange",this, "_onUploadFileChange");
>> },
>>
>> _onUploadFileChange: function(evt){
>>
>> var input = evt.target;
>> console.debug("file for upload changed:" + input.value);
>> if(input.value) {
>>
>> JVirtualDocumentSrv.addDocument(dwr.util.getValue(input), {
>>
>> callback: function(data){console.debug("file uploaded:" + data.name);},
>> errorHandler: function(message) {console.debug("file upload failed:" +

>> message);}
>>
>> })
>>
>> }
>>
>> }
>>
>>
>> *JAVA*
>> public class JVirtualDocumentSrv {
>> public void addDocument( FileTransfer file ) throws Exception {
>> InputStream in = file.getInputStream();
>> try {
>> createFile(file.getName(), in);
>> } finally {
>> in.close();
>> }
>> }
>> ...
>>
>>
>> ------------------------------
>> Charlas más divertidas con el nuevo Windows Live Messenger<http://download.live.com>
>>
>
>



Nuevo Windows Live, un mundo lleno de posibilidades Descúbrelo.

 « Return to Thread: Transfering a file using DWR 3.0 disables the "input" events