Ostrio:files package is working, but can't access image

I got the ostrio:files package working in my application, so my images are uploading to the server (as far as I know) and the DB has a reference to them, but I don’t know how to actually serve them up. For example, I uploaded an image this morning. The DB contains the original name, and the file path that it exists at now:

assets/app/uploads/Images/twLXDmCTiqyGy4Yq7.jpg

The problem is, when I put that into the url, it just returns my app’s homepage. I tried changing the upload directory to be ‘/images/’ but still have the same issue. I can’t seem to find a clear answer in Meteor’s documentation on how to open up a path for images, aside from including them when you build the package, but that defeats the purpose of user-input.

I also have noticed that the programs/web.browser/program.json file in my application seems to control what is allowed to be visible, but ideally, I would just like to open up my /images directory to view any image (only direct paths, of course - I don’t want a directory listing). Is that a possibility?

1 Like

New development: I found the config.public configuration option in the documentation, and set it to true, as well as setting the storagePath and downloadRoute paths. The paths I set are coming from the base of my server (using / for the start of the paths) but I still cannot seem to view any of the images that I upload - it just loads my default home page for my app. Can anyone help me out here, please?

I think setting the config.public configuration to true prevent ostrio:files from managing your downloads.
I have the same problems as you.

1 Like

@vjau, I don’t think so… only because the documentation specifically says

Allows to place files in public directory of your web-server. And let your web-server to serve uploaded files

when talking about the config.public setting. Have you made any progress? I still haven’t, but I have a mild hope, based on the documentation :sweat_smile:

YOUR web-server is a specific software like NGINX, not meteor, i think.

Hello @froggin ,

@vjau you right, public option is only for serving files with, nginx, haproxy, varnish and etc.

What is the current status of OP?