-
Notifications
You must be signed in to change notification settings - Fork 37
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
Broken <img> while loading #143
Comments
Hi the sample app handles this via a reactive template mechanism: When the file/thumbnail is ready to view, the reactive state change drives the DOM to attempt to load the image. |
Thanks for the reply @vsivsi, So it seems that you are setting the thumbCompletion yourself here: Which I imagine is due to something in your spec where the image is shown after being uploaded. My situation is different, because I don't have to show the image after uploading it to the DB. The user sees it later in the flow, so it's already in the DB, but while (as you put it) the DOM attempts to load the image, there is a broken image graphic. In some cases, no matter how long I wait, the image never displays. I'd say it works about half the time. Does that make sense? My code is just: It works just as often when I GET the URI directly with my browser. When it fails, the error reported by the browser's network inspector is 403 (forbidden) |
Can you reproduce this behavior on your setup using the simple sample app? You should be able to upload images to the DB, and then later reload the page and have the images promptly and correctly load (without the broken image or 403 errors). 403 errors from file-collection always (and only) result from allow/deny rules not being satisfied. That is, per the HTTP spec, permission problems. Perhaps you have a race condition affecting your permission checking, either on server and/or the client? |
@vsivsi it seems it does have to do with the permission checking, but my code is identical to your example:
When I console.log, the userId is sometimes null, so I just return true at the moment and it works. Any ideas why there would be a race condition on userId? My stack: |
Am having an issue using meteor-file-collection for displaying images. I have no problem GETting the images using the md5 URI, but when I try use the same path in an src or ng-src, the browser shows a broken image graphic until the data is ready from mongo.
In other words, it works eventually, but the UX is poor in the meantime.
Is there any way, like a data trigger of some sort, to know when the image is ready to be displayed? Am I missing something here?
ps. Thanks for such a great, flexible tool! Has been a pleasure to work with thus far.
The text was updated successfully, but these errors were encountered: