title: hiqpdf, how to save file to server instead of attachment?
body: <p>I am trying to save a PDF file to a server path rather than downloading it as an attachment, which I have made with the &quot;hiqpdf&quot; tool. :</p>
  <pre><code> protected void btnPrint_Click(object sender, EventArgs e)
      {
          // create the HTML to PDF converter
          HtmlToPdf htmlToPdfConverter = new HtmlToPdf();
  
          // set browser width
          htmlToPdfConverter.BrowserWidth = int.Parse(&quot;805&quot;);
  
          // set browser height if specified, otherwise use the default
          //if (textBoxBrowserHeight.Text.Length &gt; 0)
          //    htmlToPdfConverter.BrowserHeight = int.Parse(textBoxBrowserHeight.Text);
  
          // set HTML Load timeout
          htmlToPdfConverter.HtmlLoadedTimeout = int.Parse(&quot;180&quot;);
  
          // set PDF page size and orientation
          htmlToPdfConverter.Document.PageSize = PdfPageSize.A4;
          htmlToPdfConverter.Document.PageOrientation = PdfPageOrientation.Portrait;
  
          // set PDF page margins
          htmlToPdfConverter.Document.Margins = new PdfMargins(0);
  
          // set a wait time before starting the conversion
          htmlToPdfConverter.WaitBeforeConvert = int.Parse(&quot;5&quot;);
  
          // convert HTML to PDF
          byte[] pdfBuffer = null;
  
          //if (radioButtonConvertUrl.Checked)
          //{
          // convert URL to a PDF memory buffer
          string url = System.Configuration.ConfigurationManager.AppSettings[&quot;SiteURL&quot;] + &quot;PrintFullApplicantProfile.aspx?MaidID=&quot; + Request.QueryString[&quot;aid&quot;].ToString();
  
          pdfBuffer = htmlToPdfConverter.ConvertUrlToMemory(url);            
  
          // inform the browser about the binary data format
          HttpContext.Current.Response.AddHeader(&quot;Content-Type&quot;, &quot;application/pdf&quot;);
  
          // let the browser know how to open the PDF document, attachment or inline, and the file name
          //HttpContext.Current.Response.AddHeader(&quot;Content-Disposition&quot;, String.Format(&quot;{0}; filename=HtmlToPdf.pdf; size={1}&quot;,
          //    checkBoxOpenInline.Checked ? &quot;inline&quot; : &quot;attachment&quot;, pdfBuffer.Length.ToString()));
          HttpContext.Current.Response.AddHeader(&quot;Content-Disposition&quot;, String.Format(&quot;{0}; filename=Applicant-&quot; + Request.QueryString[&quot;aid&quot;].ToString() + &quot;.pdf; size={1}&quot;, &quot;attachment&quot;, pdfBuffer.Length.ToString()));
          // write the PDF buffer to HTTP response
          HttpContext.Current.Response.BinaryWrite(pdfBuffer);
  
          // call End() method of HTTP response to stop ASP.NET page processing
          HttpContext.Current.Response.End();
      }
  </code></pre>
  <p>Any suggestion to save the file to the server path?
  Thanks in advance.</p>