-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Support DataURI (Base64) uploads #192
Comments
This will be useful after file is changed on the client and returned as DataURI, for example image changed in canvas |
Please vote if you need this feature |
+1 |
- Support upload directly `base64` and `dataURI` strings example: ```js FilesCollection#insert({ file: 'data:image/png,…’, isBase64: true, // <— Mandatory fileName: ‘pic.png’, // <— Mandatory type: ‘image/png’ // <— Mandatory }); ```
- Compatibility with `Meteor@1.4.1.1` - Fix: #196 (use inline WebWorker if client has support, with fallback) - Implement: #192 (upload file as base64) - Closing: #182 with [React Integration Example](https://github.com/VeliovGroup/Meteor-Files/wiki/React-Example) , thanks to [@vtocco](https://github.com/vtocco) - Minor DemoApp update
v1.7.1 - Compatibility with `Meteor@1.4.1.1` - Fix: #196 (use inline WebWorker if client has support, with fallback) - Implement: #192 (upload file as base64) - Closing: #182 with [React Integration Example](https://github.com/VeliovGroup/Meteor-Files/wiki/React-Example), thanks to [@vtocco](https://github.com/vtocco) - Minor DemoApp update
Implemented in v1.7.1, see example @renatomattos2912 could you please test it on your end, and give some feedback? |
@dr-dimitru of course, i will do this now. |
@dr-dimitru it works pretty well. Thanks to be so fast in this feature. |
@renatomattos2912 , thank you for vote and for choice this package for file uploads Please, support this project by:
|
@dr-dimitru done |
Hi @renatomattos2912 , In v1.7.3 various fixes about base64 uploads. Could you test it on your end? |
Hi @dr-dimitru of course, i will try this week and soon i tell you. Thanks |
+1 |
Hi!, I've seen that I'm trying to make this work with the Thanks! |
Hello @luixal , On server the is various methods like For upload via POST check out this example |
Yep, I finally make it work using the Another thing (unrelated to this issue): in order to show images and download link, I have to use the template helper Thanks! |
Hmmm... there's another problem I'm having. According to the wiki, the
Wouldn't it be better if it returns the _id of the saved file as other collections do? If I do something like: let result = Images.write(
new Buffer(base64Data, 'base64'),
{
fileName: 'uploaded_' + (new Date()).getTime() + '.png',
type: 'image/png'
}
); would it block until result gets a value? |
@luixal document from MongoDB returned in callback
How do you call it? Need to see your code |
I finally managed to make the As for the result of the With all collections I usually call them like this: let inserted = MyCollection.insert(object); This allows me to get the inserted object and also block the function until I get a result (really useful in methods and API functions). Any idea on how to make this work that way? Thanks! |
Hi there! That's how I'm using it, was just wondering if it wouldn't be useful to make it work like regular collections :) let resultId = MyCollection.insert({...}) // <--- sync
MyCollection.insert(...); // <--- async and allows you to pass a callback or not Thanks! |
@luixal it will cost efficiency, as it will be blocking IO. Working with FS is different than DB. |
No description provided.
The text was updated successfully, but these errors were encountered: