Skip to content

Commit

Permalink
MDL-15350, use penny's patch to apply default value in uploadfile fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
dongsheng committed Jul 22, 2008
1 parent 5035228 commit b3fac92
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions repository/boxnet/boxlibphp5.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,15 @@ function UploadFile ($params = array()) {
$params['auth_token'] = $this->auth_token;
// this param should be the full path of the file
$params['new_file1'] = '@'.$params['file'];
$params['folder_id'] = 0; //Set to '0' by default. Change to create within sub-folder.
$params['share'] = 1; //Set to '1' by default. Set to '0' to make folder private.
$defaults = array(
'folder_id' => 0, //Set to '0' by default. Change to create within sub-folder.
'share' => 1, //Set to '1' by default. Set to '0' to make folder private.
);
foreach ($defaults as $key => $value) {
if (!array_key_exists($key, $params)) {
$params[$key] = $value;
}
}
$ret_array = array();
$entry_count = 0;
$data = $this->makeRequest('upload', $params);
Expand Down

0 comments on commit b3fac92

Please sign in to comment.