Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File uploaded, but UI not refreshed #97

Open
0x1d opened this issue Feb 28, 2016 · 7 comments
Open

File uploaded, but UI not refreshed #97

0x1d opened this issue Feb 28, 2016 · 7 comments

Comments

@0x1d
Copy link

0x1d commented Feb 28, 2016

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

@x5engine
Copy link

x5engine commented Mar 4, 2016

same issue :(

@RamyElkest
Copy link

Ah, i guess this is the same issue as mine #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.

@rafaelcorreiapoli
Copy link

Same issue here

@x5engine
Copy link

check the last pull request guys

@0x1d
Copy link
Author

0x1d commented Mar 22, 2016

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?

@x5engine
Copy link

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

@0x1d
Copy link
Author

0x1d commented Mar 23, 2016

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants