Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

download outside web root

  • 01-07-2013 4:00pm
    #1
    Registered Users, Registered Users 2 Posts: 263 ✭✭


    Hi guys quick q - Im looking to download files that are located outside the web root. During the upload process the users upload to a folder that was outside the root of the site (for security reasons). I now want to do the reverse for the admin users to download the files I have tried the following but to no avail

    I think maybe I need to add something to the conf file or the htaccess maybe - according to host permissions are ok!

    Is absolute apths an option also??

    $file=$_SERVER["DOCUMENT_ROOT"]. "/../uploads/".$filename;
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 10,748 ✭✭✭✭maccored


    Wouldnt downloading thru ftp just be handier? or put the files in the web root, but password protect the directory?


  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    Presumably the admins have to log in, if so, they could open a page/script that lists the files in upload directory and provides links to the files. The links would be to another script within document root. This will work because, while both scripts I describe will be under document root, they can reference files outside of it.

    I can write up some pseudo code if you want (too lazy atm)


  • Closed Accounts Posts: 8,015 ✭✭✭CreepingDeath


    If you were in a J2EE environment you could write a servlet to do it.

    You might also run into issues with MIME types.
    If you don't set the MIME type on the file they're downloading, they may only be able to open/save it, but without the MIME type hint the browser may not let you automatically open it with eg. Ms Office if it's a doc/xls.


Advertisement