Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add option formKey configuration
Browse files Browse the repository at this point in the history
Add optional configuration to change the form key used in the file upload. Currently `simpleUploadAdapter` uses the default form key `upload`. This change lets the user specify a key or, if none is specified, the default of `upload` is used.
  • Loading branch information
sg-brady committed Nov 28, 2019
1 parent d0b6a52 commit 244b04c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapters/simpleuploadadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Adapter {
// Prepare the form data.
const data = new FormData();

data.append( 'upload', file );
data.append( this.options.formKey || 'upload', file );

// Send the request.
this.xhr.send( data );
Expand Down

0 comments on commit 244b04c

Please sign in to comment.