Skip to content

Commit

Permalink
Move xhr.send to a separate overridable method
Browse files Browse the repository at this point in the history
This commit makes it possible to send files as body instead of form
data, and make other overrides to both xhr and formData before the
request is submitted.

For example:

```

Dropzone.prototype.submitRequest = function(xhr, formData, files) {
  xhr.send(files[0]);
}
```
  • Loading branch information
martinthogersen committed Jul 21, 2015
1 parent bbaa104 commit 0d255d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dropzone.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,10 @@ class Dropzone extends Emitter
# last parameter
formData.append @_getParamName(i), files[i], files[i].name for i in [0..files.length-1]

xhr.send formData
@submitRequest xhr, formData, files

submitRequest: (xhr, formData, files) ->
xhr.send formData

# Called internally when processing is finished.
# Individual callbacks have to be called in the appropriate sections.
Expand Down

0 comments on commit 0d255d0

Please sign in to comment.