title: Liferay download file structure
body: <p>In a template, I want to insert the link to download a document using Document &amp; Media Field, I do this:</p>
  
  <pre><code>#set ($gid = $getterUtil.getLong($doc.getData().split("/").get(2)))
  #set ($fid = $getterUtil.getLong($doc.getData().split("/").get(3)))
  #set ($fileTitle = $doc.getData().split("/").get(4))
  #set ($dlService = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService"))
  #set ($fileEntry = $dlService.getFileEntry($gid, $fid, $fileTitle))
  
  #set($fileTitle = $httpUtil.encodeURL($htmlUtil.unescape($fileEntry.getTitle())))
  ##Title and download link
  
  &lt;a href='/documents/$gid/$fid/$fileTitle'&gt;$fileEntry.getTitle() &lt;/a&gt;&lt;br /&gt;
  </code></pre>
  
  <p>The code is working but it crashes if I insert a file with space in the title. 
  Can anyone help me?</p>