I am wondering if I am approaching this correctly and hoping to get your feedback.
I have a rule set up when a member uploads a file to Downloads, the Downloads content item #1 is created. This triggers the creation of another Downloads content item #2. However, unlike when Downloads content item #1 is created, the creation of content item #2 doesn't upload a file or result in an entry in the downloads_files_records table. There is an entry in the downloads_files table for both file #1 and file #2.
For the file #2 content item in the File Content area I am trying to use Custom PHP Code to get the file record_location of file #1. This data is stored in the downloads_files_records table.
Question:
Within rules using PHP can I query the table downloads_files_records and pull the record_location for file #1 (e.g. monthly_2016_06/fileone.txt )? Or is there a variable I should be using?
Basically I am trying to get the file path of file #1 and display it as a URL in Downloads content item #2. To take it a step further I want to change the URL a little so that the extension is changed from fileone.txt to fileone.doc. So the whole thing will look like http://domain.com/ monthly_2016_06/fileone.doc
How can I do this in rules?
Any help will be appreciated. Thanks!