Login Register

FileInputAuto bug?

Here's my page content:

When I select a file to upload it pauses for a minute then begins to upload the file but throws this error at me:
SyntaxError: missing ) in parenthetical message=missing ) in parenthetical

Is this a bug or am I missing something?

Firebug's report

fileName: "http://localhost:9081/IAT/js/dojo/dojo.js"
lineNumber: 21
message: "missing ) in parenthetical"
name: "SyntaxError"
stack: "\"\\"()@:0\neval(\\\"(

Invoice Added Successfully

\nAdd Invoice\n)\\\")@:0\n(\\\"

Invoice Added Successfully

\nAdd Invoice\n\\\")@http://localhost:9081/IAT/js/dojo/dojo.js:20\n(\\\"

Invoice Added Successfully

\nAdd Invoice\n\\\",[object Object])@http://localhost:9081/IAT/js/dojox/widget/FileInputAuto.js:78\napply([object Object],[object Object])@:0\n(\\\"

Invoice Added Successfully

\nAdd Invoice\n\\\",[object Object])@http://localhost:9081/IAT/js/dojo/dojo.js:20\ncall([object Object],\\\"

Invoice Added Successfully

\nAdd Invoice\n\\\",[object Object])@:0\n(\\\"

Invoice Added Successfully

\nAdd Invoice\n\\\")@http://localhost:9081/IAT/js/dojo/dojo.js:20\n()@http://localhost:9081/IAT/js/dojo/dojo.js:20\n([object Object])@http://localhost:9081/IAT/js/dojo/dojo.js:20\n([object Object])@http://localhost:9081/IAT/js/dojo/dojo.js:20\n([object Object])@http://localhost:9081/IAT/js/dojo/io/iframe.js:205\n(28)@http://localhost:9081/IAT/js/dojo/dojo.js:20\n@:0\n\\"\""

** Also, there's no documentation on how to send messages to the progress bar or how to update it's progress. It just sits there and says "Uploading..." even after the file has been uploaded.

hmm. Interesting. The

hmm. Interesting. The progress bar is intentionally indeterminate because from the widget point of view, getting the size and progress numbers back from the server is very diffucult. Having some kind of hook to update a progress text would be nice, but not the intention of the widget.

Also, most importantly: FileInput* widget sets are experimental. It was the starting of a POC, and is extremely young.

Please feel free to file bugs @ trac.dojotoolkit.org against my username (dante) and put [dojox] in the heading. I would _love_ to have it "working" to a point where I could remove the dojo.experimental() call from the source. :)

Regards.

Well one of the main reasons

Well one of the main reasons I feel it's a bug is because after displaying the ProgressBar it just sits there. On the backend the image is successfully upload and a response generated, yet nothing changes. It just sits there...

you are right I think. I

you are right I think. I can't effectively test it here atm, I don't have PHP properly installed on my laptop ... I guess I just figured that aspect of the test was failing because of that.

In revision [11111] (ha! i got it!) I made some minor changes trying to track down the missing ) ... but am unable to find it. Please file a ticket at trac.dojotoolkit.org (and ideally a simple testcase, or link that can provide me with that error) ... I am unable to reproduce that one. :(

But I put in a method to set the "Uploading ... " message to something else. widget.setMessage(" a string. ");

for now you may be able to hook into that to affect the message.

Again, I can't stress enough this widget is experimental. And I currently have an "all encompassing IE6 bug" ticket, where all sorts of stuff is unfortunately broken

Regards.

I tried to find that ticket in trac

Where do I post patch suggestions?

When working in IE 6 the posted form was not encoded correctly.
The problem seemed to be that the form enctype was not getting set.
I replaced the setAttribute('enctype', 'multipart/form-data') as follows in _sendFile:

if( dojo.isIE){
encType = _newForm.getAttributeNode("enctype");
encType.value = "multipart/form-data";
formMethod = _newForm.getAttributeNode("method");
formMethod.value = "POST";
}else{
_newForm.setAttribute("enctype", "multipart/form-data");
_newForm.setAttribute("method","POST");
}

Now I get a good upload in IE6 and the result HTML instead of a type error :-)
Obviously I could have done this in two lines but this illustrates the difference better.

-Paul Dorn
Helpdeskgenius.com

Log into trac...

...using guest/guest as the login to create a ticket.

Fair word of warning: we require that you have a CLA (http://dojotoolkit.org/cla , IIRC) on file before we even look at your patch. It may seem like a PITA but it's for both our protection and yours.

When you've filed it (or if you did), make sure you say in the ticket "CLA filed on [date] by [your name on the CLA]" so that we can find it quickly and review the patch.

where is _sendFile located?

I am having this issue while dealing with file upload. I searched for _sendFile to apply the patch, but could not locate. Where is this file located?

Is this issue fixed in 1.1.1 release ?

-Smitha

Tried to file a ticket

TICKET_CREATE privileges are required to perform this operation

you must login as

you must login as guest/guest in order to create tickets. there is some weird issue relating to proxy's about logging in, if you are behind one, but otherwise, it's prety straight forward.

Another thought

I found this while searching on how to update the progress of an uploaded file. It appers it takes two(2) processes to do this. One to post the multipart/form data, and another to recursively check the file's bytes at the target location in a time-based interval(ie. 1000 = 1 second).

http://www.devpro.it/upload_progress/