<commit_before>[![Build Status](https://travis-ci.org/bahaaldine/angular-s3-upload.svg?branch=master)](https://travis-ci.org/bahaaldine/angular-s3-upload)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

# Angular S3 Upload

Angular S3 upload is a directive that buils a file input button 
to upload data on your AWS S3 server.

It supports 
 - upload success, failure, progress callback.
 - input button customization
 - passing a promise that contains your AWS S3 token.
 - i18n.

## Prerequisites 
1. Create AWS S3 bucket

2. Grant "put/delete" permissions to everyone 
In AWS web interface, select S3 and select the destination bucket, then 
expand the "Permissions" sections and click on the "Add more permissions" button. Select "Everyone" and "Upload/Delete" and save.

3. Add CORS configuration to your bucket

  In AWS web interface, select S3 and select the wanted bucket. 
  Expand the "Permissions" section and click on the "Add CORS configuration" button. Paste the wanted CORS configuration, for example: 
  ```XML
  <?xml version="1.0" encoding="UTF-8"?>
  <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
      <CORSRule>
          <AllowedOrigin>*</AllowedOrigin><commit_msg>added documentation<commit_after>[![Build Status](https://travis-ci.org/bahaaldine/angular-s3-upload.svg?branch=master)](https://travis-ci.org/bahaaldine/angular-s3-upload)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

# Angular S3 Upload

Angular S3 upload is a directive that buils a file input button 
to upload data on your AWS S3 server.

It supports 
 - upload success, failure, progress callback.
 - input button customization
 - passing a promise that contains your AWS S3 token.
 - i18n.
 - image resizing

## Prerequisites 
1. Create AWS S3 bucket

2. Grant "put/delete" permissions to everyone 
In AWS web interface, select S3 and select the destination bucket, then 
expand the "Permissions" sections and click on the "Add more permissions" button. Select "Everyone" and "Upload/Delete" and save.

3. Add CORS configuration to your bucket

  In AWS web interface, select S3 and select the wanted bucket. 
  Expand the "Permissions" section and click on the "Add CORS configuration" button. Paste the wanted CORS configuration, for example: 
  ```XML
  <?xml version="1.0" encoding="UTF-8"?>
  <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
      <CORSRule>
          <AllowedOrigin>*</AllowedOrigin>
{'fraction_non_alphanumeric': 0.10620525059665871, 'fraction_numerical': 0.020684168655529037, 'mean_word_length': 4.164271047227926, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 2, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3123140', 'n_tokens_mistral': 780, 'n_tokens_neox': 749, 'n_words': 272}