• hello everyone,
    i use w3tc plugin for uploading images and data to aws s3 cdn.
    i want to be able to upload the data to a directory of my choice,
    for example instead of:

    “wp-content\….”

    i want:

    “other-directory\wp-content\…”

    looking into the code the remote path contains the location of where the file will be app load in s3 cdn.

    how can i change this? which filter do i need to add?
    i’m new to wordpress development so i would be glad for code examples and where to put the code, the file name etc…

    thank you very much!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ortala2

    (@ortala2)

    hi, i found out how to change the remote path, but it’s not by a hook filter.

    in Cdn_Core.php
    in function:

    function build_file_descriptor( $local_path, $remote_path ) {
    $file = array( ‘local_path’ => $local_path,
    ‘remote_path’ => “ortal-test/” . $remote_path,
    ‘original_url’ => $this->relative_path_to_url( $local_path ) );

    $file = apply_filters( ‘w3tc_build_cdn_file_array’, $file );
    return $file;
    }

    Thread Starter ortala2

    (@ortala2)

    is there is a way to change this by a hook filter?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘change file remote path on aws s3 cdn to a custom directory’ is closed to new replies.