Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent direct access to files from URL #14

Closed
benny-adiwijaya opened this issue Jul 13, 2021 · 8 comments
Closed

Prevent direct access to files from URL #14

benny-adiwijaya opened this issue Jul 13, 2021 · 8 comments

Comments

@benny-adiwijaya
Copy link

Hi,

In your demo project I noticed that user cant access files from url, thats good. I try to create new project with blazor wasm and using this library but cant prevent direct access to files from URL. So, is there any configuration to prevent direct access to files from URL?

@trannamtrung1st
Copy link
Owner

Hi @benny-adiwijaya ,
You can move those static files out of the wwwroot folder, and store it somewhere that users can only access via a Controller. Did I understand your question properly?

@benny-adiwijaya
Copy link
Author

Allright thats work, thank you

@benny-adiwijaya
Copy link
Author

Hi @trannamtrung1st, moving those static files out of the wwwroot folder can prevent direct access to files from URL, unfortunately the preview command is not working. So, how to prevent direct access to files from URL eventhough those static files are inside wwwroot folder just like in your demo project?

@trannamtrung1st
Copy link
Owner

Hi @benny-adiwijaya , do you have any idea why the preview didn't work?

@benny-adiwijaya
Copy link
Author

I think because preview is handled by elFinder client only and not by controller so when I try to preview I get status code 404 not found. Is there any solution?

@trannamtrung1st
Copy link
Owner

trannamtrung1st commented Jul 16, 2021

Hi, it seems we need some extra works. I already encapsulated a default behavior in the package elFinder.Net.AspNetCore and released v1.2.6. You can use your own logic since it is not too complicated.
Please see the Advanced Demo project. There are some updates in the Startup class and FilesController.

@benny-adiwijaya
Copy link
Author

Hi @trannamtrung1st, thank you it works. but with video preview I can't forward or rewind.. can it be fixed?

trannamtrung1st added a commit that referenced this issue Jul 19, 2021
Enable range processing
@trannamtrung1st
Copy link
Owner

Hi, thanks for pointing that out. According to Microsoft doc, I published a minor release 1.2.6.1 of the AspNetCore package. Just update the package and it will work.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants