Answers.Body: <p>Can you check </p>
  
  <ol>
  <li>Check if base url in civicrm.settings.php file is set '<a href="http://remotedomain.com/" rel="nofollow noreferrer">http://remotedomain.com/</a>'.</li>
  <li>Try setting home and siteurl in wp_options table to '<a href="http://remotedomain.com/" rel="nofollow noreferrer">http://remotedomain.com/</a>' (not needed for normal install). </li>
  </ol>
  
  <p>Cheers</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T12:12:02.053Z
Answers.Text: `civicrm.settings.php` has a value for `CIVICRM_UF_BASEURL` that is set for the correct remote URL, including the last `/`
  
  `wp_options` already has both values set with the correct remote domain, including the `/` at the end.
Answers.UserDisplayName: repertor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T12:15:38.617Z
Answers.Text: How about in  civicrm.settings.php?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T12:16:59.813Z
Answers.Text: Return submitting and not doing a line return in comments always gets me
Answers.UserDisplayName: repertor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T12:48:51.070Z
Answers.Text: I may have discovered a bug. I `print_f`d the globals `$civicrm_root, $civicrm_setting, $civicrm_paths` and saw on the remote server that even though `[wp.frontend.base]` was defined in `civicrm.settings.php` with the slash (I could see it _right there_ in the variable definition), it was being dropped. So I added another slash. Then there were two! So I removed one, and now it's working...!
Answers.UserDisplayName: repertor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-16T09:22:18.487Z
Answers.LastActivityDate: 2019-07-16T09:22:18.487Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm working locally on my Mac with the latest version of CiviCRM on latest WordPress, served by MAMP. Using the API, I create an attachment to a contact, and those attachments successfully display after being retrieved through the API. The URL comes back as <code>http://localhost/civicrm?page=CiviCRM&amp;q=civicrm%2Ffile&amp;reset=1&amp;id=15&amp;eid=29&amp;fcs=...</code></p>
  
  <p>However, when I upload the code and database records to the remote server for testing, the one thing that doesn't work are my attachments. The URLs come back from the API missing a slash: <code>http://remotedomain.comcivicrm?page=CiviCRM&amp;q=civicrm%2Ffile&amp;reset=1&amp;id=15&amp;eid=29&amp;fcs=...</code> Notice the missing slash after the `.com?</p>
  
  <p>I've double checked the configuration in civicrm.settings.php. Both localhost and remotedomain.com have a / in the URL base. I checked the various settings in the admin interface, but nothing looks amiss.</p>
  
  <p>What could be causing this issue?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-15T23:11:32.143Z
Comments.Text: Just a thought: Is the remote server linux or windows?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-15T23:20:57.050Z
Comments.Text: I'm assuming Linux since the paths begin with /home/username/
Comments.UserDisplayName: repertor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-15T23:56:02.947Z
Comments.Text: Ok it was just a thought. It seems to work ok on wpmaster.demo.civicrm.org, using the api explorer, so it makes me think it would be something to do with config somewhere.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-16T02:49:15.040Z
Comments.Text: A configuration issue seems to be the likely explanation, right!?
  But I export the DB from localhost to remote, swapping in the domain with find-and-replace. And I upload the config file as-is, with code that inserts `http://localhost/` or `http://remotedomain.com/` as applicable with the terminal slashes. So what gives...?
Comments.UserDisplayName: repertor
Tags: <api><attachments>
Title: Attachment URLs incomplete on remote server only
ThreadText: # Attachment URLs incomplete on remote server only
  
  (Asked by: username_0 on 2019-07-15)
  
  I'm working locally on my Mac with the latest version of CiviCRM on latest WordPress, served by MAMP. Using the API, I create an attachment to a contact, and those attachments successfully display after being retrieved through the API. The URL comes back as `http://localhost/civicrm?page=CiviCRM&q=civicrm%2Ffile&reset=1&id=15&eid=29&fcs=...`
  
  However, when I upload the code and database records to the remote server for testing, the one thing that doesn't work are my attachments. The URLs come back from the API missing a slash: `http://remotedomain.comcivicrm?page=CiviCRM&q=civicrm%2Ffile&reset=1&id=15&eid=29&fcs=...` Notice the missing slash after the `.com?
  
  I've double checked the configuration in civicrm.settings.php. Both localhost and remotedomain.com have a / in the URL base. I checked the various settings in the admin interface, but nothing looks amiss.
  
  What could be causing this issue?
  
  **Tags:** api, attachments
  
  > **Comments:**
  > **username_1**: Just a thought: Is the remote server linux or windows?  
  > **username_0**: I'm assuming Linux since the paths begin with /home/username/  
  > **username_1**: Ok it was just a thought. It seems to work ok on wpmaster.demo.civicrm.org, using the api explorer, so it makes me think it would be something to do with config somewhere.  
  > **username_0**: A configuration issue seems to be the likely explanation, right!? But I export the DB from localhost to remote, swapping in the domain with find-and-replace. And I upload the config file as-is, with code that inserts `http://localhost/` or `http://remotedomain.com/` as applicable with the terminal slashes. So what gives...?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-07-16. Score: 1
  
  Can you check
  
  1. Check if base url in civicrm.settings.php file is set '<http://remotedomain.com/>'.
  2. Try setting home and siteurl in wp\_options table to '<http://remotedomain.com/>' (not needed for normal install).
  
  Cheers
  
  Pradeep
  
  > **Comments:**
  > **username_0**: `civicrm.settings.php` has a value for `CIVICRM_UF_BASEURL` that is set for the correct remote URL, including the last `/`  `wp_options` already has both values set with the correct remote domain, including the `/` at the end.  
  > **username_2**: How about in  civicrm.settings.php?  
  > **username_0**: Return submitting and not doing a line return in comments always gets me  
  > **username_0**: I may have discovered a bug. I `print_f`d the globals `$civicrm_root, $civicrm_setting, $civicrm_paths` and saw on the remote server that even though `[wp.frontend.base]` was defined in `civicrm.settings.php` with the slash (I could see it _right there_ in the variable definition), it was being dropped. So I added another slash. Then there were two! So I removed one, and now it's working...!  
  
  ---
  
  