Download Images from slim server with angular


#1

Hello
I need help for this:
I have an angular application
My angular aplication uploads images to slim application server (not angular application server)
but when I try to display or download the image there isn’t a route, I can access to folders in the server through php but there is no way to send the image to angular or access to folder in the server or get access to path with .jpg and use that path in angular

How i can create a route with paths of images using slim with angular?

thank you


#2

What have you tried?

Either you save the image files in a public accessible directory or you use a special Slim Route which fetches the files from an internal folder and delivers them.


#3

I think the only way to access something in slim is with a route, if i make public a folder where is the privacy? I have the files names saved in a database, I need a path to folder through a route to use in angular but how I do that?


#4

You would need to write a custom method to stream your file and a midlewar or somting to only allow that route when logedin. Ive done this before and I’ll post an example when I’m at my computer.


#5

use cdn like cloudinary


#6

Check Slim 3 Download Files.