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.

Multiple site manager uploading to a file destination on another site

December 14, 2011 5:01pm

Subscribe [3]
  • #1 / Dec 14, 2011 5:01pm

    ibuck

    19 posts

    I have a ExpressionEngine 2 installation with the MultipleSiteManager installed.

    There are two sites:

    * default_site
    * mobile

    From the mobile site I am trying to add a new file to a upload destination that is setup in the default_site via a custom module.

    So as an example I am trying to do this from the mobile site:

    $this->EE->filemanager->upload_file($dir_id, ‘field_id_8’) where $dir_id is a dir_id from the default_site.

    I am getting a “You do not have access to this upload directory.” error that is being thrown in ~/system/expressionengine/libraries/FileManager.php line 1074. This is to be expected because the file manager is looking for that id on the current site, which is mobile.

    Does anyone know how I can use the filemanager to upload to the default_site from the mobile?

    Thanks,
    Mike

  • #2 / Dec 14, 2011 5:32pm

    Boyink!

    5011 posts

    Can’t you just setup a file upload destination that points at the same images location as your main site uses?

  • #3 / Dec 14, 2011 5:44pm

    ibuck

    19 posts

    Can’t you just setup a file upload destination that points at the same images location as your main site uses?

    No. This form is actually creating a new photo channel entry in the default site. The channel entry has a file field. So when I create that channel entry I also need to create the new file upload obj so it can be linked to the entry.

    Is an easier way to create a new Channel entry on the default site?

  • #4 / Dec 14, 2011 5:46pm

    Boyink!

    5011 posts

    Sorry…missed the “custom module” part.

    Have you looked at SafeCracker for forms that create entries?

  • #5 / Dec 14, 2011 6:08pm

    ibuck

    19 posts

    Sorry…missed the “custom module” part.

    Have you looked at SafeCracker for forms that create entries?

    I haven’t. I will do some reading.

    Thanks

  • #6 / Dec 14, 2011 6:38pm

    ibuck

    19 posts

    Ok that looks like it will be a much better solution. I’ve created a safecracker form and it setup a safecracker file field. When I go to create this default_site entry from the “mobile” site I get the error “Photo - You do not have access to this upload directory.”.

    Is there something I have to do in the control panel to allow this upload destination to be used via safecracker?

  • #7 / Dec 14, 2011 7:10pm

    ibuck

    19 posts

    Thanks for your help. This post can be closed. I will re-open another to address the file upload permissions.

  • #8 / Dec 15, 2011 5:56pm

    Kevin Smith

    4784 posts

    Closing.

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

ExpressionEngine News!

#eecms, #events, #releases