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.

File Not Found :(

See original GitHub issue

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 !

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
marcelastrapicommented, Feb 14, 2018

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 😃 :

ImagesFiles = new FilesCollection({
    collectionName: 'imagesFiles',
    storagePath: () => {
        return `${process.env.PWD}/uploads`;
    },
});
1reaction
dr-dimitrucommented, Mar 19, 2018

Okay, then simply:

ROOT_URL="http://51.254.123.90:3000" meteor
Read more comments on GitHub >

github_iconTop Results From Across the Web

File Not Found Error In Preview but the File IS There
I get an error that says "File Not Found Error It may have been moved, edited, or deleted" ERR_FILE_NOT_FOUND I'm getting this in...
Read more >
File not found or Path not found errors - Exalt
The reason you may experience a Path or File not found error is due to the incorrect set up of file-system paths (folders...
Read more >
“File Not Found Check The File Name And Try Again” Error In ...
Solution: Through Windows Security Settings · Step 1: Click the Start button on your desktop and select Settings from the context menu, located ......
Read more >
Random "File not found" error on Project:Support desk
After testing and deciding that this is what I need, I made a different folder - carteamuntilor.ro - and I moved the wiki...
Read more >
How to Fix File Not Found Windows 10 Error
How to Resolve File Not Found Windows 10 Error · Select Start > Settings; Choose Update & security > Windows Defender. · Hit...
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