question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I implement CollectionFS's isUploaded feature?

See original GitHub issue

I’m trying to migrate from CollectionFS to Meteor-Files but is now stock at codes using isUploaded function.

The scenario is, the UI is rendered by a jade template, and it has code like this:

each attachments
  .attachment-item
    a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}")
      if isUploaded
        if isImage
          img.attachment-thumbnail-img(src="{{url}}")
        else
          span.attachment-thumbnail-ext= extension
      else
        +spinner

I tried to add a meta field called isUploaded and use a helper to return this.meta.isUploaded, but I found neither in the onUploaded function nor .on('end', callback) I can get the FileCursor object to update meta.isUploaded. When I call Attachments.findOne(fileObj._id) it always returns undefined.

Since the UI is jade templated it’s hard for me to do like “receive event, pass to another jade template, and update templated UI”. I’m not that familiar to meteor-jade templating, so I’d rather have a reactive variable (function?) solution.

So is there a way to simply implement CollectionFS’s isUploaded feature? Thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
urakagicommented, Dec 3, 2019

@dr-dimitru Got it, I think I need to modify the interface since __pre-colletion also is not the solution. I’ll close this issue, thank you very much.

1reaction
urakagicommented, Nov 26, 2019

Great! Seems like it’s what I want. Thank you very much.

dr.dimitru notifications@github.com 於 2019年11月25日 週一 下午10:22寫道:

@urakagi https://github.com/urakagi to write (e.g. update) a record in MongoDB you have to use it as any other MongoDB collection (no magic here), good place to update your record would be onAfterUpload hook https://github.com/VeliovGroup/Meteor-Files/blob/master/docs/constructor.md or afterUpload event https://github.com/VeliovGroup/Meteor-Files/blob/master/docs/constructor.md#event-map

Lear more about Mongo.Collection instances here https://github.com/VeliovGroup/Meteor-Files/wiki/Collection-Instances

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VeliovGroup/Meteor-Files/issues/718?email_source=notifications&email_token=AASCEPFM6WNLELCW2VH77D3QVPNRRA5CNFSM4JP6JXT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFCRYFA#issuecomment-558177300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASCEPGMLNOHKENHTJAFW7DQVPNRRANCNFSM4JP6JXTQ .

– Romulus Urakagi Ts’ai

Read more comments on GitHub >

github_iconTop Results From Across the Web

FSS Implementation Guide - NALC Branch 3825
Implementation of FSS. F4 Changes. The introduction of FSS has a significant impact on the Function 4 work load in an affected office....
Read more >
anneharun3/File-Sharing-System-FSS-using-only-Java-sockets
In order for the TA to verify that you have implemented this functionality the program MUST print the progress of upload/download as it's...
Read more >
Overview of File Storage - Oracle Help Center
The service systematically traverses deleted files and file systems, frees all the used space, and eradicates all residual files. Use the File ...
Read more >
Performance of MFT Cloud Service (MFTCS) with File Storage ...
FSS can be used for high throughput use cases where a large number of large files have to be processed within MFTCS.
Read more >
What is File Storage Security? - Trend Micro Cloud One
How it works. When a user or program uploads a file to a designated cloud storage container, File Storage Security performs a scan....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found