mdr-angular-file
v1.0.5
Published
File Upload Drag and Drop
Downloads
5
Maintainers
Readme
Angular File
Angular File is an Angularjs component that can upload files via XMLHttpRequest, provides drag & drop support.
##Features
- Uses the native Angularjs scope for data binding
- Drag & Drop
- Multiple or single files uploads
- Image preview
- Update progress
- Large files support
##Requirements
##Quick start
Several quick start options are available:
- Download the latest release
- Clone the repo:
git clone https://github.com/Modulr/mdr-angular-file.git
. - Install with Bower:
bower install mdr-angular-file
. - Install with npm:
npm install mdr-angular-file
.
##What's included
mdr-angular-file/
dist/
├── mdr-file.css
├── mdr-file.min.css
├── mdr-file.js
└── mdr-file.min.js
##Documentation
####Usage
######Load CSS
<link href="mdr-angular-file/dist/mdr-file.min.css">
######Load JS
<script href="mdr-angular-file/dist/mdr-file.min.js"></script>
######Code
angular.module('MyApp', ['mdr.file'])
######HTML View or Templates
Basic Directive
<mdr-file url="upload.php"></mdr-file>
Complete Directive (All attributes)
<mdr-file url="upload.php" model="model" data="{hola:'mundo'}" headers="{token:'shhh'}" size="5" limit="10" formats="'jpg,png,gif'" disabled="true" multiple="true" text="Arrastra o haz clic aquí"></mdr-file>
####API
######Attributes
Attribute | Type | Description
--- | --- | ---
url | string
| Is the path on the server where the file will be uploaded. Note: The parameter received on the server is file
model | object
| It is the scope model where will be received to response the server.
data | object
| Data to be sent to the server.
headers | object
| Send headers to the server.
size | number
| Max size in MB to file.
limit | number
| Max number files to upload.
formats | string,array
| Extensions permitted to the file.
multiple | boolean
| If required to upload a multiple file is marked as true.
disabled | boolean
| If required disable the component is marked as true.
text | string
| Text into area drag and drop.
##How to contribute
All contributions are very welcome, We love it. There are several ways to help out:
- Create an issue on GitHub, if you have found a bug
- Write test cases for open bug issues
- Write patches for open bug/feature issues, preferably with test cases included
- Contribute to the documentation
There are a few guidelines that we need contributors to follow so that we have a chance of keeping on top of things.
If you want to making changes Better avoid working directly on the master
branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch dev
, into folder src/
.
##Community
- Implementation help may be found at Stack Overflow (tagged
mdr-file
).
##Creators
Copyright and license
Code and documentation (c) Copyright 2015 Modulr. Code published under license MIT