I have a site which requires a username and password to access. With in this site is some directories with pdf files.
I use perl to decide what pdf files to display and links to them for downloading based on there username.
This works great, however if some were to find out the name of one of the pdf files they do not have access to, they could in theory download it.
Now I have listing turned off in apache, and the file names are random when created, so it is unlikely but not impossible.
I can tell apache to only allow the localhost to access these directories, this allows for perl to get the file names and list them, however the downloading will not work. So if I can get perl on the local host to grab the file and then display it, the above would work for me.
So my question is -> is there some way in perl to grab a file and display it for downloading?
Or if I'm just going about this all wrong and someone knows a better way I would appreciate getting pointed in the right direction.
I use perl to decide what pdf files to display and links to them for downloading based on there username.
This works great, however if some were to find out the name of one of the pdf files they do not have access to, they could in theory download it.
Now I have listing turned off in apache, and the file names are random when created, so it is unlikely but not impossible.
I can tell apache to only allow the localhost to access these directories, this allows for perl to get the file names and list them, however the downloading will not work. So if I can get perl on the local host to grab the file and then display it, the above would work for me.
So my question is -> is there some way in perl to grab a file and display it for downloading?
Or if I'm just going about this all wrong and someone knows a better way I would appreciate getting pointed in the right direction.