From eaf80d0d9c1d157802b56f79c7b810b2f464838b Mon Sep 17 00:00:00 2001 From: Yanxi Date: Fri, 27 Mar 2015 17:28:01 +0800 Subject: [PATCH 1/3] update main field in package.json The "main" field defines which file should take charge if you use require() --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73923998..f4ec5806 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "grunt-contrib-concat": "~0.5.0" }, "description": "angular-file-upload ===================", - "main": "Gruntfile.js", + "main": "dist/angular-file-upload.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, From 467b708247e6a4e9b320fa6b1273ec201e0d4a5e Mon Sep 17 00:00:00 2001 From: Danial Farid Date: Mon, 13 Apr 2015 16:22:55 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c086afef..a2b9fadf 100644 --- a/README.md +++ b/README.md @@ -161,10 +161,14 @@ upload.abort(); /* alternative way of uploading, send the file binary with the file's content-type. Could be used to upload files to CouchDB, imgur, etc... html5 FileReader is needed. It could also be used to monitor the progress of a normal http post/put request. - Note that the whole file will be loaded in browser first so large files could crash the browser. - You should verify the file size before uploading with $upload.http(). */ -$upload.http({...}) // See 88#issuecomment-31366487 for sample code. +$upload.http({ + url: '/server/upload/url', + headers : { + 'Content-Type': file.type + }, + data: file +}) ``` **Upload multiple files**: Only for HTML5 FormData browsers (not IE8-9) if you pass an array of files to `file` option it will upload all of them together in one request. In this case the `fileFormDataName` could be an array of names or a single string. For Rails or depending on your server append square brackets to the end (i.e. `file[]`). From 1faa303fc42c42af41cce8b7e08ef9355a8bca07 Mon Sep 17 00:00:00 2001 From: Danial Farid Date: Mon, 13 Apr 2015 16:25:12 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2b9fadf..9d6437fd 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Table of Content: ## Features * Supports upload progress, cancel/abort upload while in progress, File drag and drop (html5), Directory drag and drop (webkit), CORS, `PUT(html5)`/`POST` methods. * Cross browser file upload (`HTML5` and `non-HTML5`) with Flash polyfill [FileAPI](https://github.com/mailru/FileAPI). Allows client side validation/modification before uploading the file -* Direct upload to db services CouchDB, imgur, etc... with file's content type using `$upload.http()`. This enables progress event for angular http `POST`/`PUT` requests. See [#88(comment)](https://github.com/danialfarid/angular-file-upload/issues/88#issuecomment-31366487) for discussion and usage. +* Direct upload to db services CouchDB, imgur, etc... with file's content type using `$upload.http()`. This enables progress event for angular http `POST`/`PUT` requests. * Seperate shim file, FileAPI files are loaded on demand for `non-HTML5` code meaning no extra load/code if you just need HTML5 support. * Lightweight using regular `$http` to upload (with shim for non-HTML5 browsers) so all angular `$http` features are available @@ -174,8 +174,8 @@ $upload.http({ **Upload multiple files**: Only for HTML5 FormData browsers (not IE8-9) if you pass an array of files to `file` option it will upload all of them together in one request. In this case the `fileFormDataName` could be an array of names or a single string. For Rails or depending on your server append square brackets to the end (i.e. `file[]`). Non-html5 browsers due to flash limitation will still upload array of files one by one in a separate request. You should iterate over files and send them one by one if you want cross browser solution. -**$upload.http()**: You can also use `$upload.http()` to send the file binary or any data to the server while being able to listen to progress event. See [#88](https://github.com/danialfarid/angular-file-upload/issues/88) for more details. -This is equivalent to angular $http() but allow you to listen to progress event for HTML5 browsers. +**$upload.http()**: +This is equivalent to angular $http() but allow you to listen to the progress event for HTML5 browsers. **Rails progress event**: If your server is Rails and Apache you may need to modify server configurations for the server to support upload progress. See [#207](https://github.com/danialfarid/angular-file-upload/issues/207)