<p>Turns out you need to have the URL prefix set under the Asset Settings in order to call .getUrl()
<a href="https://i.sstatic.net/bchmZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bchmZ.png" alt="enter image description here"></a></p>

<p>Once I added this, my transforms began working.</p>

CC BY-SA 3.0
2017-05-22T19:16:18.550Z
Be sure to configure the protocol correctly as well. https:// http:// or //
joshwa
CC BY-SA 3.0
2017-05-22T18:18:42.723Z
2017-05-22T18:18:42.723Z
joshwa
<p>I can load the s3 image fine using the s3 base path and the craft cms filename that is saved in the craft cms database:</p>

<p><code>&lt;img src="{{cdnUrl}}/filepath/{{entry.Image.first().filename }}" /&gt;</code><br>
renders<br>
<code>&lt;img src="cdn.imageurl.com/filepath/filename.jpg" /&gt;</code>  </p>

<p>However if I want to access the same image without the s3 base path (e.g. in order to use an image transform), I get a null. </p>

<p><code>&lt;img src="{{entry.Image.first().getUrl('transform')}}" /&gt;</code><br>
renders<br>
<code>&lt;img src="" /&gt;</code>  </p>

<p>Any help would be appreciated!</p>

CC BY-SA 3.0
2017-05-20T16:10:24.467Z
Does it work if you call `getUrl()` without the transform argument?
Stephen Lewis
<assets><image-transforms><s3>
asset.first().getUrl('transform') not working for s3 asset - Craft CMS 2.6.2980
# asset.first().getUrl('transform') not working for s3 asset - Craft CMS 2.6.2980

(Asked by: username_0 on 2017-05-19)

I can load the s3 image fine using the s3 base path and the craft cms filename that is saved in the craft cms database:

`![]({{cdnUrl}}/filepath/{{entry.Image.first().filename }})`  
renders  
`![](cdn.imageurl.com/filepath/filename.jpg)`

However if I want to access the same image without the s3 base path (e.g. in order to use an image transform), I get a null.

`![]({{entry.Image.first().getUrl('transform')}})`  
renders  
`![]()`

Any help would be appreciated!

**Tags:** assets, image-transforms, s3

> **Comments:**
> **username_1**: Does it work if you call `getUrl()` without the transform argument?  

---

## 1 answers

### Answer by username_0 on 2017-05-22. Score: 1 | Accepted answer

Turns out you need to have the URL prefix set under the Asset Settings in order to call .getUrl()
[![enter image description here](https://i.sstatic.net/bchmZ.png)](https://i.sstatic.net/bchmZ.png)

Once I added this, my transforms began working.

> **Comments:**
> **username_0**: Be sure to configure the protocol correctly as well. https:// http:// or //  

---

