Skip to content

Commit

Permalink
fix configure field name and detect transport
Browse files Browse the repository at this point in the history
  • Loading branch information
sokil committed Dec 2, 2019
1 parent abefc0c commit 78865b9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Handler.php
Expand Up @@ -24,9 +24,14 @@ class Handler

public function __construct($options = array())
{
// configure field name
if (isset($options['fieldName'])) {
$this->options['fieldName'] = $options['fieldName'];
}

$fieldName = $this->options['fieldName'];

// transport
// detect transport
if (!isset($options['transport'])) {
if (isset($_FILES[$fieldName])) {
// iframe upload
Expand All @@ -42,16 +47,10 @@ public function __construct($options = array())
$this->options['transport'] = $options['transport'];
}


// supported formats option
if (isset($options['supportedFormats']) && is_array($options['supportedFormats'])) {
$this->options['supportedFormats'] = array_map('strtolower', $options['supportedFormats']);
}

// field name
if (isset($options['fieldName'])) {
$this->options['fieldName'] = $options['fieldName'];
}

// checksum
if (isset($options['validateChecksum'])) {
Expand Down

0 comments on commit 78865b9

Please sign in to comment.