ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Member specific file upload directories

October 26, 2012 1:21pm

Subscribe [0]
  • #1 / Oct 26, 2012 1:21pm

    ciadeveloper

    10 posts

    I’ve found these forums to be a great resource for figuring out issues I’ve been having developing a new site with ExpressionEngine.  There is a feature of the site for which I haven’t seen an answer to.  Well, I found one possible in the form of a module to buy, but I want to see if there are other ideas first…..

    The site will allow members to log in and create new entries within a specific channel.  I’ve been using SafeCracker to develop the form to allow the member to populate the fields for the channel entry.  We are wanting to have a photo attached to each entry.  A single member will be making multiple channel entries, each with a different photo.  Everything is working great so far, including uploading photos.

    However, we would like to segregate each member’s set of photos to aid in file management and security to prevent one member from deleting/overwriting/using another member’s photos.  Is there a solution for having member specific file upload directories?  I saw there is a module, Subdir Upload, on devot-ee but haven’t look at it in detail yet.  I first wanted to see if there was a way of adding in the feature without additional modules.

    If anyone has thoughts or ideas, I’d appreciate it.
    —Chris

  • #2 / Oct 29, 2012 12:09pm

    Kevin Smith

    4784 posts

    Hi Chris,

    Great question. The system isn’t set up to handle this natively, and in fact, you have to specify the upload directory for a given channel field in the CP, so that can’t change based on the particular member.

    Do these members have CP access or are they only creating new entries from the SafeCracker form? If that’s the case, I’m not sure segregating members’ photos would really provide all that much benefit.

  • #3 / Oct 29, 2012 4:09pm

    ciadeveloper

    10 posts

    The more I play with the system the more I am understanding it and some of my concerns have been alleviated.  Yes, users will only add/update entries through SafeCracker.  So, without a file manager there isn’t a concern with users deleting/changing another user’s photos.  I’ve discovered I can turn off the “Or choose existing…” option, so a user can’t see any uploaded files (their or others).  I also see that SafeCracker/EE will rename files that are uploaded with the same name as an existing file (and I’ve found the Bug Report for the odd “temp_file_” renamed prefix). 

    The only issue I can think of at the moment is the potential for photos to be orphaned when a user updates an entry with a new photo.  However, that issue would occur regardless of if there are user specific directories.

  • #4 / Oct 30, 2012 12:42pm

    Kevin Smith

    4784 posts

    Right, and that’s a potential side effect with all files uploaded. Files can be uploaded directly to the File Manager, so we can’t exactly go through and cull all files that aren’t connected to an entry. It’s an interesting problem without an easy solution, to be sure.

    Anything else I can help with?

  • #5 / Oct 30, 2012 1:35pm

    ciadeveloper

    10 posts

    That’s all I have on this issue (and no other problems that have been researched).  Thanks!

    —Chris

  • #6 / Oct 31, 2012 5:21pm

    Kevin Smith

    4784 posts

    Great! Glad I could help. Have a good one, Chris.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases