Accessing a folder and files within wp-content

Hi, I was wondering if someone could help me I have a client file manager which stores all the files uploaded into the wp-content/clientfiles/ directory I have created that part is successful but when I try to download a file it gives me a '500 internal server error'.

Is there a way to prevent this so that anyone can access these files (there isn't a need for security)?

  • ThePath
    • The Bug Hunter

    Hi James, hope your having a good day!

    Can you give me a bit more detail please?

    So in WP you have changed the way Wordpress saves your files (default is in month and year folders) and you are then trying to access them via a direct URL in your address bar, something like: http://www.mysite.com/wp-content/clientfiles/myfile.pdf

    Is that about right?

    Also what are your files?

    Im pretty sure these files may be protected by chmod on your server. So you may have to allow access making the 755 or summit.

    However the way to let people access your files is to add them to Wordpress posts and pages.

    Cheers

  • James
    • Design Lord, Child of Thor

    Hey, thanks for getting back to me so quickly.

    I haven't changed how WordPress saves files i am basically using a plugin to upload specific files to a directory, which I am having no problem doing, the problem is that I want users to be able to download those files.

    Yes the directory is; http://mysite.com/wp-content/clients_file/myfile.doc

    The filetypes are pretty standard; doc, docx, pdf, rtf, etc. )i have changed file permissions to 777 and 755 and had no luck.

    The files being shared this way go through a basic login, nothing high-tech as they don't have to be secure the client just wants to make them 'less' available.

  • ThePath
    • The Bug Hunter

    Whats the plugin?

    I havent found a decent "client area" plugin.

    Also you dont really need a plugin.

    Here is what I would do:

    Install WP Multisite.

    Create a subsite for each client. Use the Multisite Privacy plugin right here at WPMUDev to password protect each client subsite.

    Then you can use the native Wordpress media uploader to upload files and link to them from a standard WP page.

    Very easy. No silly Client Area plugins required, and probably gives you better security this way.

    Im just about to write a tutorial here on how to do something very similar as Ive just dont it for a Photographer clint.

    What do you reckon? Do you have multisite instaled or is it just single site?

    If you want to try this route and have to change from singlt to multisite then there is a neat tut here: https://premium.wpmudev.org/manuals/wpmu-manual-2/creating-a-network-to-enable-wordpress-multisite/

    Hope that helps dude.

  • aecnu
    • WP Unicorn

    Greetings James,

    Though I have never personally tried what you are doing I would try it via the uploads folder instead where WordPress expects files for downloads to be and the htaccess file possibly causes the internal server error since it is geared form normal WordPress operation.

    Something like /wp-content/uploads/clients_file/file.doc

    Also what are the permissions of the files within the http://mysite.com/wp-content/clients_file/ folder?

    Please advise and if you try out my upload folder theory please let us know how it goes.

    Looking forward to hearing form you in any event.

    Cheers, Joe

  • ThePath
    • The Bug Hunter

    You can set it all up via FTP. No server access required.

    If thats all a bit OTT for ya then Id suggest doing what aecnu suggests and simply use the default WP media uploader. Then you can put your content on pages and password protect them for each client if you want. Very simple.

  • James
    • Design Lord, Child of Thor

    Hi Sorry for the delay, thanks for all the help but the client changed the spec the other day so have found it easier to use WP-Client, it is a bit over the top for file sharing but after some changes and making it simpler it seems to do everything my client needs which is great, thank you very much for your help, the WP-Client does use the uploads folder for sharing files which is great as I don't get the issue!

  • ThePath
    • The Bug Hunter

    @Imperative Ideas no I cant say I have but it looks pretty good. There has been a gap in the market here for some time. If I had the skill I would have exploited it a long time ago. Glad somebody has. If I have something like this come up for a client I will seriously look at it.

    Nice website too, always the first thing I look at.

  • James
    • Design Lord, Child of Thor

    Sorry for the delay in getting back to you, it's made here!

    @Imperative Ideas I totally agree the WP-Client is the best around tried so many and failed but this does work really well, but the admin area definitely needs cut back, its hard to find what you need quickly and there are many tabs that could all be under the same tab. I am not looking forward to showing my client how it works....

  • aecnu
    • WP Unicorn

    Greetings Everyone,

    It looks like to me that another treasure has been uncovered and thank you all for your feedback and discussion thereof and absolutely appreciated.

    I absolutely enjoyed checking over the site and look forward to giving it a workout soon.

    Thank you all for being WPMU DEV Community Members and have a GREAT week ahead!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.