Answers.Body: <p>What if you just use <code>&lt;a href="{{ file.url }}"&gt;</code>? So, without the siteUrl part? If your Asset source's URL setting is correct (so, the complete url, preferably using {siteUrl}), that should do the trick ...</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T20:10:07.140Z
Answers.Text: I tried that, but it only returns the file path, like `/public/assets/sdfsdfds.jpeg` without the website url.
Answers.UserDisplayName: Marlon Marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T20:20:28.973Z
Answers.Text: And what's your assets source's URL setting?
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T20:25:06.850Z
Answers.Text: File System Path: {basePath}/assets/uploads/
  
  URL: /public/assets/uploads/
Answers.UserDisplayName: Marlon Marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T20:33:44.640Z
Answers.Text: Url should be the complete url to your file, so for instance {siteUrl}public/assets/uploads. That way, {{ file.url }} always works, even if you change the siteUrl config setting.
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T21:00:23.903Z
Answers.Text: Ohh man, that's it. Haha. Thanks for your time @paul-verheul appreciate that. You might wanna add that to your answer for future reference. Thanks again.
Answers.UserDisplayName: Marlon Marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T20:02:00.287Z
Answers.LastActivityDate: 2015-03-23T21:01:54.250Z
Answers.LastEditDate: 2015-03-23T21:01:54.250Z
Answers.UserDisplayName: Paul
Body: <p>I'm trying to send some assets links through email, but using <code>{{ siteUrl  ~ file.link }}</code> returns an url with double forwards slashes like: <code>http://example.com//public/assets/sdfsdfds.jpeg</code></p>
  
  <p>I couldn't find a method on the <strong>AssetsFileModel</strong> that generates a direct link to it. Is there an easy way to do this?</p>
  
  <p>Thanks!</p>
  
Tags: <templating><assets>
Title: Direct link to asset
ThreadText: # Direct link to asset
  
  (Asked by: username_0 on 2015-03-23)
  
  I'm trying to send some assets links through email, but using `{{ siteUrl ~ file.link }}` returns an url with double forwards slashes like: `http://example.com//public/assets/sdfsdfds.jpeg`
  
  I couldn't find a method on the **AssetsFileModel** that generates a direct link to it. Is there an easy way to do this?
  
  Thanks!
  
  **Tags:** templating, assets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-03-23. Score: 3 | Accepted answer
  
  What if you just use `<a href="{{ file.url }}">`? So, without the siteUrl part? If your Asset source's URL setting is correct (so, the complete url, preferably using {siteUrl}), that should do the trick ...
  
  > **Comments:**
  > **username_0**: I tried that, but it only returns the file path, like `/public/assets/sdfsdfds.jpeg` without the website url.  
  > **username_1**: And what's your assets source's URL setting?  
  > **username_0**: File System Path: {basePath}/assets/uploads/  URL: /public/assets/uploads/  
  > **username_1**: Url should be the complete url to your file, so for instance {siteUrl}public/assets/uploads. That way, {{ file.url }} always works, even if you change the siteUrl config setting.  
  > **username_0**: Ohh man, that's it. Haha. Thanks for your time @username_1-verheul appreciate that. You might wanna add that to your answer for future reference. Thanks again.  
  
  ---
  
  