meteor-autoform-file
                                
                                
                                
                                    meteor-autoform-file copied to clipboard
                            
                            
                            
                        File uploaded, but UI not refreshed
When uploading an image, sometimes the progressbar does not update and is stuck at 0%, even though the file was successfully uploaded to the server. In some cases, the UI eventually refreshes after waiting a very long time... It is unpredictable to me when this happens, what's always is printed in the client console is following warning: cfs_upload-http.js:138: The provided value 'undefined' is not a valid enum value of type XMLHttpRequestResponseType.
I've setup my schema as described in the example: https://github.com/yogiben/meteor-autoform-file#multiple-images
I'm using Meteor 1.2.1 and autoform-file 0.4.2
Does anyone have a solution to this problem?
Thanks in advance
same issue :(
Ah, i guess this is the same issue as mine https://github.com/yogiben/meteor-autoform-file/issues/100, only my file actually gets uploaded (receives a response from the server) after ~ 2 mins, UI refresh part is instant i suppose. I do get the same warning
The provided value 'undefined' is not a valid enum value of type XMLHttpRequestResponseType.
Thanks for noting that, i didn't notice that, i'll try to dig deeper.
Same issue here
check the last pull request guys
cool, i'll try if it works in the next couple of days. but the fix will only work for files with size > 2mb? can't this be tweaked so that the filesize doesn't matter?
No I meant this fixes the issue for files under 2MB so it will show all progress for all files...
Try it and tell me thanks
thanks for your contribution, i've tested the pull request, and it's almost working ;)
there is still an issue in autoform-file.coffee line 78.
the line should be:
(if doc then doc.isUploaded() else undefined) and doc._id
doc != null in coffee script is equivalent doc !== null in JS, which will resolve to true, because doc is undefined....
after this modification, the file upload works like a charm :)
this will fix the following error in the js console: Exception in template helper: TypeError: Cannot read property 'isUploaded' of undefined at Object.Template.afFileUpload.helpers.value (http://localhost:3000/packages/yogiben_autoform-file.js?92f4b34a1c115acdcda913bcbd0c149214fee28f:306:31) at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:2986:16 at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:1650:16 at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3038:66 at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3671:12) at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3037:27 at Spacebars.call (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:167:18) at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:104:25) at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:108:39) at Template.afFileUpload.HTML.DIV.HTML.INPUT.value (http://localhost:3000/packages/yogiben_autoform-file.js?92f4b34a1c115acdcda913bcbd0c149214fee28f:97:24)
following warning is still present in the js console while uploading files: The provided value 'undefined' is not a valid enum value of type XMLHttpRequestResponseType.
nevertheless, it's working now ;)