title: S3 signed url not working with ajax
body: <p>I am trying to upload file directly to S3 with pre-signed URL, but can't get it working, checked all the related posts, but can't find any solution. I was able to upload via angular in another project, the below code is working.</p>
  
  <pre><code>const req = new HttpRequest('PUT', preSignedUrl, file, {
      reportProgress: true
  });
  
  $this._http.request(req).subscribe(e =&gt; {
      if (e.type === HttpEventType.UploadProgress) {
          ...
      } else if (e instanceof HttpResponse) {
          ...
      }
  })
  </code></pre>
  
  <p>However, now i'm trying to get the same output with Ajax but I'm getting 403 Forbidden. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.</p>
  
  <p>Here is the code thats not working:</p>
  
  <pre><code>$.ajax({
      type: 'PUT',
      url: preSignedUrl,
      // Content type must much with the parameter you signed your URL with
      headers: {
          "Content-Type": file.type,
          'x-amz-acl': 'public-read'
      },
      // this flag is important, if not set, it will try to send data as a form
      processData: false,
      // the actual file is sent raw
      data: file
  })
      .success(function () {
          alert('File uploaded');
      })
      .error(function () {
          alert('File NOT uploaded');
          console.log(arguments);
      });
  </code></pre>
  
  <p>Please Help</p>