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.

Dynamic upload folder for channel entry files

November 16, 2012 8:27am

Subscribe [1]
  • #1 / Nov 16, 2012 8:27am

    Mediakitchen

    261 posts

    I have a requirement to include in the CMS the ability for the client to upload some training modules that each consist of a number of swf files. I had planned to just upload all the files to a file upload folder I had set up.

    However I have now realised on receipt of the files that each module has the same file names.

    e.g

    module 1:

    menu.swf
    page1.swf
    page2.swf
    etc

    module 2:

    menu.swf
    page1.swf
    page2.swf
    etc

    So my solution would not work as the files from module 2 would overwrite the files from module 1.

    So I would like to know if there is a way to dynamically create a sub-folder of the upload destination.

    So instead of uploading module1 to a folder such as “http://www.mysite.com/modules” - it would upload the files to “http://www.mysite.com/modules/module1” and module 2 files to “http://www.mysite.com/modules/module2” etc

    Essentially I need to set up the CMS to allow the client to add modules where the modules consist of multiple files whereby the filenames of each module are identical.

    I don’t even think giving access to the client to create new upload destinations would work as the channel field for the file would not know in advance what upload folder it can be uploaded to.

    Any advice much appreciated.

  • #2 / Nov 20, 2012 9:42am

    Dan Decker

    7338 posts

    Hi Mediakitchen,

    It took a bit of digging, but I remembered there was an add-on that would do just this on a per-entry basis. Entry Directories will create a new folder on the server based on the value of a channel field.

    The caveat would seem to be getting the files into the right place afterwards. It might be best to implement an FTP solution given the circumstances.

    Another suggestion is DevDemon’s Channel Files - it actually looks like a better fit and would be the easiest for your client to work with.


    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases