title: REMOTE URL UPLOAD in Laravel 5
body: <p>I'm trying to make a site to upload files in Laravel, but I  can't :( , If I use PHP without a framework, everything work, but with it (Laravel), I get ERRORS and that is a problem.</p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>&lt;form id="remote_upload" method="POST"&gt;
        @csrf 
        &lt;input name="url" id="url" type="url" /&gt;
        &lt;input name="upload" id="upload" type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>My AJAX code:</strong></p>
  
  <pre><code>$(document).ready(function(){
  
   $('#remote_upload').on('submit', function(event){
      event.preventDefault();
      $.ajax({
       url: "{{ route('remote_upload') }}",
       method:"POST",
       data: new FormData(this),
       // IF WE HAVE ANY FUNCTION TO SET UPLOAD PROGRESS FOR REMOTE UPLOAD - PLEASE TELL ME :) 
       xhr: function() {
            var myXhr = $.ajaxSettings.xhr();
            if(myXhr.upload){
                myXhr.upload.addEventListener('progress', progressHandlerHome, false);
                myXhr.addEventListener("load", completeHandlerHome, false);
                myXhr.addEventListener("error", errorHandlerHome, false);
                myXhr.addEventListener("abort", abortHandlerHome, false);
            }
            return myXhr;
        },
       dataType:'JSON',
       contentType: false,
       cache: false,
       processData: false,
       // IF SUCCESS
       success:function(data)
       {
          $('.result').html(data.link);
       }
    });
   });
  
  });
  </code></pre>
  
  <p>And this is my Controller:</p>
  
  <pre><code>protected function remote_upload(Request $request) {
          $file = file_get_contents($request-&gt;url_file);
  
          // UPLOAD FILE
          if (getValue('storage_type', 'disk') == 's3') {
              $path = Storage::disk('s3')-&gt;putFile('files', $file);
              $storage = 's3';
          } else {
              $path = Storage::putFile('files', $file);
              $storage = 'disk';
          }
  
          return response()-&gt;json([
              'link' =&gt; $path
          ]);
      }
  </code></pre>
  
  <p>I don't know if we have a package to upload files from URL in Laravel :) </p>
  
  <blockquote>
    <p><strong>Note</strong>: About upload verification (Check if URL, If Have SSL ...), I will do that, but I hope you see me, how to add the upload progress, the real size of the file and its original name through the URL only, <strong>Before upload it</strong> :)</p>
  </blockquote>
  
  <p>Thanks</p>