pimous's avatar

How to create dynamically routes (to access pdf files in the browser)

Hi, I have a filemanager ( https://github.com/simogeo/Filemanager ) and I use the editor CKEditor. So I can redirect links to pdf files with my editor.

Hebergeur d'image

But I have a route problem, actually links to the pdf have no route how to have a system for accessing these pdfs with a web browser ?

Hebergeur d'image

0 likes
9 replies
bobbybouwmann's avatar

If you place the files in the public directory it should work...

2 likes
mikevrind's avatar

Routes to actual files shouldn't be processed by Laravel. Else you should create routes for every file? Are you absolutely sure the URL to the file is correct?

And just as @bobbybouwmann says, the files should be stored somewhere in your public directory.

1 like
pimous's avatar

Yes I know that :) I think it is a configuration problem with the filemanager, because the link in the adress bar isn't correct. So it's not a Laravel problem I think, my bad ...

bobbybouwmann's avatar

Can you show how you store the file? We might be able to help you here ;)

1 like
pimous's avatar

So in the file manager.config.js :

filemanager

I have a problem with the parameter "baseUrl". I tried to write in hardcode the url locations for the userfiles and it works, but I don't want this ^^ What am I supposed to add/do ? Do you want to see an another file ?

(I do all my tests with WAMP)

bobbybouwmann's avatar

Maybe find a way to get the base url of your application! Just google on it and report back

pimous's avatar

Yes it works, but If I create a new folder with the filemanager, I can't use the element who are inside because It searchs the file to the url indicated.

@bestmomo porpose this config on his blog, but it doesn't work

Hebergeur d'image

pimous's avatar

The problem is the url in this field (URL field) isn't correct, because it take only the baseUrl and don't add the children repository, why ?

Hebergeur d'image

jekinney's avatar

Show your route from route file and your controller method. If your returning a view, it's looking in the view folder.

Please or to participate in this conversation.