Meteor-Files icon indicating copy to clipboard operation
Meteor-Files copied to clipboard

After file upload, file is not existed in local file storage

Open seniordev555 opened this issue 8 years ago • 34 comments

After file upload is finished, it shows such messages in console. image

So there is no file saved in storage.

Does anyone face this problem before?

My version is ostrio:[email protected] & [email protected]

seniordev555 avatar Apr 17 '18 11:04 seniordev555

Hello @seniordev555 ,

Thank you for reporting this. We need more info, please follow our issue template:

  • Could you update to the latest release?
  • Are you using http or ddp upload protocol?
  • What are you using for storagePath option?
  • Where this issue appears? OS (Mac/Win/Linux)? Browser name and its version?
  • Post Client and/or Server logs with enabled debug option, you can enable "debug" mode in Constructor

dr-dimitru avatar Apr 17 '18 11:04 dr-dimitru

  1. Yes I am using the latest.
  2. Http protocol.
  3. I've set absolute path in storagePath
  4. Mac and chrome Version 65.0.3325.181
  5. allowClientCode: true, debug: true,

seniordev555 avatar Apr 17 '18 13:04 seniordev555

@seniordev555 for the no.5 we would like to see screenshot or copy/pasted text from server and client logs (console)

dr-dimitru avatar Apr 17 '18 13:04 dr-dimitru

This is the model class:

const fileSchema = {
  ...FilesCollection.schema,
  verified: {
    type: Boolean,
    defaultValue: false
  }
};

const File = new FilesCollection({
  collectionName: 'files',
  schema: fileSchema,
  storagePath: process.env.UPLOAD_FILES_PATH || '/uploads/files',
  allowClientCode: true,
  debug: true,
  downloadCallback(fileObj) {
    if (this.params.query.download == 'true') {
      // Increment downloads counter
      File.update(fileObj._id, {$inc: {'meta.downloads': 1}});
    }
    // Must return true to continue download
    return true;
  },
});

This is the console when file is uploaded: image

seniordev555 avatar Apr 17 '18 14:04 seniordev555

As you can see, after file is uploaded, it is automatically removed and said removeUnfinishedUpload.

So file is not saved in local storage.

seniordev555 avatar Apr 17 '18 15:04 seniordev555

@seniordev555 please try to upload file without using Schema.

dr-dimitru avatar Apr 17 '18 16:04 dr-dimitru

It is same issue, file is not saved.

image

seniordev555 avatar Apr 17 '18 16:04 seniordev555

Is the /uploads/files path exists? What permissions does it have?

dr-dimitru avatar Apr 17 '18 16:04 dr-dimitru

process.env.UPLOAD_FILES_PATH has own value for file path.

/Volumes/Data/Work/project/files

This folder exists.

seniordev555 avatar Apr 17 '18 16:04 seniordev555

Is it writable? What permissions does it have?

dr-dimitru avatar Apr 17 '18 16:04 dr-dimitru

Try with setting 777:

sudo chmod -R 777 /Volumes/Data/Work/project/files

dr-dimitru avatar Apr 17 '18 16:04 dr-dimitru

This is the updated file permission: image

Still removed: image

seniordev555 avatar Apr 17 '18 16:04 seniordev555

Is there any thoughts about this strange behavior?

seniordev555 avatar Apr 17 '18 17:04 seniordev555

@seniordev555 please update to the latest release v1.9.10. This release may solve your issue.

dr-dimitru avatar Apr 17 '18 19:04 dr-dimitru

Let me try.

seniordev555 avatar Apr 17 '18 19:04 seniordev555

Hmm, I think 1.9.10 is suitable for meteor 1.6.1.1

But my meteor project is 1.6.0.1 and it shouldn't upgrade due to some reason.

seniordev555 avatar Apr 17 '18 20:04 seniordev555

@seniordev555 so what version you're on now? Latest and current version are for [email protected] and newer.

dr-dimitru avatar Apr 17 '18 20:04 dr-dimitru

My meteor version is 1.6.0.1

And ostrio:files version is 1.5.6.

For some reason, I am not able to upgrade my meteor version.

seniordev555 avatar Apr 17 '18 20:04 seniordev555

@seniordev555 sorry, since v1.5.6 many issue were solved, and we can't guarantee version that old would work properly. You had to upgrade.

dr-dimitru avatar Apr 17 '18 20:04 dr-dimitru

I can upgrade to v 1.9.4.

But still have same issue

seniordev555 avatar Apr 17 '18 20:04 seniordev555