title: ASP.NET VB File download from table link
body: <p>I have a populated table from a database in my VB ASP.NET application, like so:</p>
  
  <pre><code>&lt;dl class="row"&gt;
      &lt;dd style="width:20%; background:none;"&gt;
          &lt;%# Eval("name")%&gt;
      &lt;/dd&gt;
      &lt;dd style="width:20%;"&gt;
          &lt;%# Eval("description")%&gt;
      &lt;/dd&gt;
      &lt;dd style="width:30%;"&gt;
          &lt;a href="&lt;%# Eval("templateLink")%&gt;"&gt;&lt;%# Eval("templateId")%&gt;&lt;/a&gt;
      &lt;/dd&gt;
  &lt;/dl&gt;
  </code></pre>
  
  <p>Now, I have saved link to the template in <code>templateLink</code> and I'm using <code>Guid</code> as it's name, namely <code>templateId</code>.
  Now, when I click that link I want to be able to save the file, but now it does not do that. I can't even access the file on server (on dev environment I can access but still can't download).</p>
  
  <p>This is the path I'm using.</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;appSettings&gt;
          &lt;add key="UploadLocation" value="C:\inetpub\wwwroot\MyProject\Intranet\Resources\"/&gt;
      &lt;/appSettings&gt;
  &lt;configuration&gt;
  </code></pre>
  
  <p>And this is the upload code:</p>
  
  <pre><code>Dim TempEx As String = System.IO.Path.GetExtension(fuTemp.FileName)
  Dim TempPath As String = ConfigurationManager.AppSettings("UploadLocation")
  Dim TempName As String = report.TempID.ToString + TempEx
  
  fuTemp.PostedFile.SaveAs(TempPath + TempName)
  
  report.TemplateLink = TempPath + TempName
  </code></pre>
  
  <p>As you can see, I'm saving the path to TemplateLink which I'm using later to create the <code>a href</code> for the table. I tried using several solutions I've found around the web but couldn't make much use of it.</p>
  
  <p>If possible please clarify this problem to me :(</p>
  
  <p>Thank you.</p>