title: Laravel upload file outside root path
body: <p>I tried everything but cannot get a file upload to work.</p>
  
  <p>I want it to upload to:</p>
  
  <p>/var/www/mysite.com/uploads</p>
  
  <p>Laravel is located at:</p>
  
  <p>/var/www/mysite.com/admin/public/</p>
  
  <p>Latest thing I tried was making a filesystem like this:</p>
  
  <pre><code>'uploads' =&gt; [
      'driver' =&gt; 'local',
      'root' =&gt; '/var/www/mysite.com/uploads'
  ]
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>'uploads' =&gt; [
      'driver' =&gt; 'local',
      'root' =&gt; '../../uploads'
  ]
  </code></pre>
  
  <p>none of them did work.</p>
  
  <p>Can anyone please tell me how I can upload files, outside of my Laravel directory to the directory I specified above?</p>
  
  <p>EDIT: The error I receive:</p>
  
  <p>League \ Flysystem \ Exception
  Impossible to create the root directory "/var/www/mysite.com/uploads/image.jpg".</p>
  
  <p>Also tried this:</p>
  
  <pre><code>'uploads' =&gt; [
      'driver' =&gt; 'local',
      'root' =&gt; dirname(dirname(dirname(__FILE__))).'/uploads'
  ]
  </code></pre>
  
  <p>with controller code:</p>
  
  <pre><code>$path = $request-&gt;file('image')-&gt;store(
      'image.jpg', 'uploads'
  );
  </code></pre>