Meteor-Files: File Not Found :(
I’m having an issue:
Hello everybody, thanks for this explicit and user friendly upload utilities ! I have a strange problem that I can’t explain: sometimes, ImagesFiles are not found anymore.
ostrio:files 1.9.7 Meteor 1.6.1 Linux Mint 18.3 Sylvian, Mozilla Firefox 58.0.2
There is no bug, no error except that when I open the image, it say “file not found 😦”
I declare my Collection like that:
ImagesFiles = new FilesCollection({
collectionName: 'imagesFiles',
allowClientCode: false,
onAfterUpload(fileRef){
createThumbnails(this, fileRef, (error, thumbnail) => {
if (error) {
console.error("error during thumbnail creation",error);
}else{
console.log("thumbnail created for " +fileRef.name);
}
});
}
});
Publish:
Meteor.publish('ImagesFiles', function (searchObj) {
if (!searchObj) searchObj = {};
console.log("I publish ImagesFiles",searchObj);
return ImagesFiles.find(searchObj).cursor;
});
Use in template helpers:
src(){
return ImagesFiles.findOne(this.id).link(); // (where this is an object containing the id of the file)
},
The strange things is that It give me the link: “http://localhost:3000/cdn/storage/imagesFiles/4sFy8e8Tdr3EMFTE2/original/4sFy8e8Tdr3EMFTE2.jpg” The stranger things (haha), is that the “thumbnail” version is correctly displayed. An other strange things is that it begin by working, all images are displayed, and after some time, after refreshing, the are gone…
Surely I do something wrong but I can’t understand what…
(I’m a lilttle noob maybe it’s why…)
Thanks for your help !
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (10 by maintainers)
Okay so you were right @dr-dimitru , I don’t reset the project but just restart meteor, and all the files were gone, so I will put them somewhere else. Thanks a lot !
I add the way to implement storagePath, because it was not easy easy for me 😃 :
Okay, then simply: