Use case: Unable to sort images by upload date client side.
Suggestion: Track upload date server side and include in db, and serve with Image object client side.
Documentation is missing: How to manually add properties to an image server side (transform object during upload)
It is not clear to me if it is appropriate to add properties to a file in the onBeforeUpload hook _server side_ (examples are only explicit about how to call other functions, not about how to transform the file).
Documentation is hard to find: How to manually add properties to an image client side (transform object during upload) (things like user ID, other relevant info)
/docs/addFile.md
I looked at the Insert api with onStart, but no example is linked from this page: /wiki/Insert-(Upload). It would be nice if the insert api row where meta is listed referenced via link /docs/addFile.md.
Requests:
Actually, it would be nice if the main page had those main sections with massive bold titles...
Related Evidence:
https://github.com/VeliovGroup/Meteor-Files/issues/459
You can see here another used had this use case, and had trouble determining how to do it. Although the meta object is how to add client-side attributes, and it is not obvious in docs how/when to add things to meta. Also, I would like to add server side UTC timestamps...not client side JS timestamps that may be completely incorrect or faked by a user.
Hello @FEA5T ,
How to manually add properties to an image server side
You're able to "transform" object after upload in onAfterUpload hook, or afterUpload event at server side.
It is not clear to me if it is appropriate to add properties to a file in the
onBeforeUploadhook server side (examples are only explicit about how to call other functions, not about how to transform the file).
onBeforeUpload should be only used to approve or decline upload. It is generally security hook, where you can check on both Server and Client what user is sending.
How to manually add properties to an image client side (transform object during upload) (things like user ID, other relevant info)
This option only related to .addFile() method and __may__ not work with other methods.
I looked at the Insert api with onStart, but no example is linked...
.insert() method are individual for .insert() method, not related to .addFile() method and vice versa.Can a server side UTC automatic timestamp on upload be added to the lib by default?
No, this may break existent implementations.
Can you tell me how to add this myself (transform an image server side before upload)?
Yes, use meta object in onAfterUpload hook or afterUpload event. __But__ only after upload, IDK how it may be possible to "transform" object on server __before___ upload. 🤷♂️
Can you document this (more explicitly with an example if it can be done) and in an obvious place?
meta object isn't a secret in our docs, anyways PRs are always welcome.
Actually, it would be nice if the main page had those main sections with massive bold titles
If you've got confused with it and spent a lot of time to figure it out, you're welcome at our Gitter channel and at forums.meteor.com - there you can get a quick help.
User feedback 1: Server side UTC timestamp before file upload is an expected feature
Response: Rejects user feedback. Refuses to acknowledge need for it. Dodgy response "may break existing implementations" - there is always a way.
User feedback 2: Need a way to add server side UTC timestamp before file upload
Response: Rejects user feedback. Offers option after upload or client side option, neither solves use case. Client side time is insecure. Server after upload is inaccurate.
User feedback 3: Meta documentation is lacking/hard to find/no examples (several users)
Response: Rejects user feedback. Dodgy response "it's not a secret", when several users have already reported that it is hard to find.
Lastly, I just wanted to say one thing about not having a timestamp here. It is absolutely baffling to me that any engineer would ever allow an object to be written to db without a timestamp (there should be multiple timestamps for created, modified, deleted etc). I understand that this is your library but this is grossly negligent. No serious implementer would ever put this code into production without one. You should seriously take some time to think about finding a way to add this. I am just going to move to another library for now because of (a) not having a timestamp (b) no way to add one properly and of course (c) no attempt to take user feedback seriously.
There is a famous saying: "The customer is _always_ right."
There is a famous saying: "The customer is always right."
Have you paid for this software?
Have you paid for this software?
You are welcome to ignore all feedback from all your users, but in the end it will only hurt you. Some individuals just do not take feedback well I suppose, sad to see you become so defensive over your inability to take feedback.
FYI:
onInitiateUpload(file) {
file.createdOn = new Date().getTime();
},