Answers.Body: <p>You should be able to get it with the <code>getURL()</code> method?</p>
  
  <p>Something like this should work (NB! have not tested the code myself):</p>
  
  <pre><code>$image = $entry-&gt;image-&gt;first();
  if ($image) {
      $url = $image-&gt;getUrl();
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-19T12:27:37.063Z
Answers.Text: He's asking about the path, not the URL
Answers.UserDisplayName: Fuglsetrampen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-29T16:40:10.137Z
Answers.LastActivityDate: 2017-07-29T16:40:10.137Z
Answers.UserDisplayName: KSP
Body: <p>I've written a simple plugin that attaches to the onSaveEntry event. I'd like to access the image, extract the colours from the image using <a href="https://github.com/brianmcdo/ImagePalette" rel="nofollow noreferrer">https://github.com/brianmcdo/ImagePalette</a> and then save these colours to a field. I've managed to access the entry, but can't seem to find how to get the path and filename of the image?</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Thanks</p>
  
Tags: <plugin-development><assets>
Title: How do I get the full path of an asset?
ThreadText: # How do I get the full path of an asset?
  
  (Asked by: username_0 on 2017-07-28)
  
  I've written a simple plugin that attaches to the onSaveEntry event. I'd like to access the image, extract the colours from the image using <https://github.com/brianmcdo/ImagePalette> and then save these colours to a field. I've managed to access the entry, but can't seem to find how to get the path and filename of the image?
  
  Any help would be greatly appreciated!
  
  Thanks
  
  **Tags:** plugin-development, assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-07-29. Score: 0
  
  You should be able to get it with the `getURL()` method?
  
  Something like this should work (NB! have not tested the code myself):
  
  ```
  $image = $entry->image->first();
  if ($image) {
      $url = $image->getUrl();
  }
  
  ```
  
  > **Comments:**
  > **username_2**: He's asking about the path, not the URL  
  
  ---
  
  