Meteor-files: How to update collection with modified path after uploaded file was moved

Created on 10 Aug 2017  路  3Comments  路  Source: veliovgroup/Meteor-Files

Hi,

Depending on the program flow, I may need to move each uploaded file to a different individual folder tree afterwards on the server. (I cannot do this at upload time with storagePath(), since at that time the folder tree is still unknown.) What I do now, is after I moved the file I update the file document fileRef.path with the new path. However this does not seem to be sufficient, because when I then afterwards e.g. remove the document from the collection, the moved file is not automatically deleted anymore. So what else do I need to take care of?

Thanks in advance

question

Most helpful comment

That works! Thanks a million for your excellent support!

All 3 comments

Hello @Avijobo ,

There is three properties used to physically locate the file:

  1. fileRef.path
  2. fileRef._storagePath
  3. fileRef.versions.original.path

See Schema docs

Let me know if it helped.

That works! Thanks a million for your excellent support!

@Avijobo great! I'm glad we have solved it.

Please, support this project by:

Was this page helpful?
0 / 5 - 0 ratings