Jump to content

Save files assets different server


recyclerobot
 Share

Recommended Posts

Hi, I'm currently trying to setup a multi server setup here and I was wondering if anybody has any experience in saving the /site/assets/files to a different server,

currently I have a front-end templates server, a backend mysql server and a fileserver setup, I'm trying to implement PW into this flow, anybody has done this before?

Kind regards!

  • Like 1
Link to comment
Share on other sites

So long as the servers can share a common file system (or give that appearance), you should be able to set this up. For instance, your /site/assets/ could be a symlink to a dir on another server. But PW needs to be able to scan this directory for files, open files that are in it, and place new files into it when it needs to. PW uses PHP functions like move_uploaded_file(), copy(), rename(), getimagesize() and others to act upon the files in /site/assets/ as needed, which is why they must be accessible as if they were local.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By AndZyk
      Hello,
      we have many projects as pages containing images inside regular image fields and repeater matrix elements. Now we would like to organize our assets.
      ProcessWire saves assets with id as folder name and makes separate folders for repeater matrix elements.
      Is there a way to collect all assets of one page and export them in a folder with the page name/title?
      I think I could achieve this by using the command line wget for this website or maybe by a hook. But maybe someone has done this before. 😉
      Regards, Andreas
    • By donatas
      Hi,
      I am trying (wondering if even possible) to set a very different file folder path for my PW install. The path I want to set exist in the same server, but in another domain. Can the PW API see that far into file system? It is a shared hosting environment so no permission management options available.
      Also can this be achieved through .htaccess redirection? If you request a file (images mostly, but translation json files are important too) from `domain-A.com/site/assets/files/` to grab them from `domain-B.com/site/assets/files/`? I would prefer to do this through PW API, I can see the function `$config->setPath()` but it didn't work when set in  config.php like `$config->setPath("files", "/domains/domain-B/public_html/site/assets/files/")`.
      Is there some other option to do this?
      My ultimate goal is to have two PW installs on different domains but one is just a "mirror" that is using the same database as the other and should use the same files structure if editors upload any images to the main (domain-B.com) website. I could use domain parking function but it then needs a more expensive SSL certificate for two domains , which I am trying to avoid if possible 🙂 (I'd like to use single domain Let's Encrypt certificates, thus I need to PW installs).
      Would appreciate any insight! Thanks!
    • By prestoav
      Hi there, I'm hoping someone can help here.
      I've just moved a new site from my development server account over (where the site was working fine for the client to edit content pre-launch) to the client's final hosting account and the live site is all fine. However, while most edits can be done without an issue, image uploads in admin cannot. I know this has been an issue before but, having trawled the posts about it and suggested esolutions I still can't resolve it on their host.

      PW Version: 3.0.123
      PHP version: 7.3.20
      max_execution_time 160
      max_upload_size 256M
      GD Library is enabled

      Looking at the console data it looks like the AJAX request from the image upload is getting a 403 error which is suggesting a permissions issue? First we get this on console:
       
      ?id=1169&s=1&c=1:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 Then, the AJAX request:
       
      https://*******/admin/page/edit/?&id=1169&InputfieldFileAjax=1 Gets a 403 according to Chrome Dev Tools > Network XHR. Also, the response is empty.

      Can anyone point me in the direction of the directory that deals with this and what the permission should be to allow it or indeed any other fix / area to investigate?

      Thanks so much for your help.

       
    • By dotnetic
      Hi folks, I published "Simple file downloads with ProcessWire tutorial"  today which explains how to make a simple download function with ProcessWire (tested with version 3.0+).
      Basically this is based on my post here in the forums 
       
    • By hellerdruck
      Hi all
      I need help with something. Situation: We have let's say 2'000 Files (Excel) that should be displayed (list with links) on a page. We'd need to filter these files by given Keywords or a tree structure or both. Now, I'm looking for a solution whereas our customer can synchronise the files from his local computer with the folder on the webserver. They will update and upload files on a daily basis. Therefore, it would need to synchronise rather than load the files manually in pages or repeaters. Maybe indexing would be an idea, too.
      Are there any modules for Processwire that would help achieving this? Could anyone point me in the right direction?
      Thanks in advance.
×
×
  • Create New...