-
Notifications
You must be signed in to change notification settings - Fork 46
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
entry.toURL() should create a blob url instead of filesystem URL #5
Comments
Hey any ideas how one could implement this? |
Right now Creating a blob and a
That URL can then be used for previews and whatnot. I've updated the demo to do this. Down the road, it might be nice to bake this in under the hood. I'd have to change some stuff around though Hopefully that helps. |
Ah yeah awesome. I got confused with another issue i`m facing. I really like about the filesystem that you can predict the file urls without actually creating a file. With blobs you first have to create the blob and then the url which is a synchronous act. So the idea was to create all the existing blobs from the db and create all the urls in advance but this might be a memory nightmare :-) |
It's an interesting idea, but we're talking possibly hundres of object URLs. I think you're right it's not the memory tradeoff. |
I ended up replacing toURL with:
I think it makes more sense to make the URL actually work, otherwise is a bit confusing. The memory issue is interesting, but feel the tradeoff for usability is worth it. Perhaps a warning on the index would make sense, to remind programmers since it's a shim, there are some memory drawbacks to toURL and to handle accordingly. |
That might be worth doing, although |
How about something like this?
In FileWriter.write a new blob is created already, so it would remove the temporary variable, and would not be accidentally be written to the datastore. |
I like that. |
Unsupported browsers don't understand filesystem: URLs so they cannot be used out of the box.
The motivation for even implementing toURL() was to make the lib compatible with filer.js.
I should look into this.
The text was updated successfully, but these errors were encountered: