title: Replacing a php file with a Vaadin view in Java
body: <p>I have been working with Vaadin for a bit, I am wondering if it is possible to substitute a php file with a Vaadin view.</p>
  <p>So in Java, I normally go to a PHP-page to retrieve a file from my server. An indirect download, I guess. In my java project, I have the following code:</p>
  <pre><code>URL url = new URL(&quot;fileinphp.php&quot;);
              HttpURLConnection conn = (HttpURLConnection)url.openConnection();
              conn.setRequestMethod(&quot;GET&quot;);
              conn.setConnectTimeout(3000);
              conn.connect();
  </code></pre>
  <p>The php-page that sends the image is as such:</p>
  <pre><code>$file_name = $_GET['file'];
  $file_url = '/files/' . $file_name;
  header(&quot;Content-Description: File Transfer&quot;);
      header('Content-Type: ' . mime_content_type($file_url));
      header(&quot;Content-disposition: attachment; filename=\&quot;&quot;.$file_name.&quot;\&quot;&quot;);
      readfile($file_url);
  </code></pre>
  <p>Now. I want to try to do the same in Vaadin. So I have tried to make the following page, and connect to it through the url-method above.</p>
  <pre><code>@Route(&quot;myroute&quot;)
  public class Test extends Div {
  
  public Test() {
      add(new Label(&quot;Does this get through?&quot;));
  }
  }
  </code></pre>
  <p>All of this combined, provides me with the following body:</p>
  <pre><code>To test your app with this browser, enable transpilation in development mode.&lt;/p&gt;&lt;p&gt;Transpilation can be enabled by setting the &lt;code&gt;vaadin.devmode.transpile=true&lt;/code&gt; property for the deployment configuration using an application or a system property.&lt;p&gt;&lt;p&gt;Note that transpilation is always enabled for the &lt;code&gt;build-frontend&lt;/code&gt; Maven goal, which is also used when creating a production build of the application.
  </code></pre>