Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 7fa916d

Browse files
committed
ENH: refs #0319. Fix documentation of api method upload.getoffset
1 parent 3023da9 commit 7fa916d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

modules/api/controllers/components/ApiComponent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ function uploadGeneratetoken($args)
263263
}
264264

265265
/**
266-
* Get the offset of the current upload
267-
* @token The upload token for the file
268-
* @return The size of the file currently on the server
266+
* Get the size of a partially completed upload
267+
* @param uploadtoken The upload token for the file
268+
* @return [offset] The size of the file currently on the server
269269
*/
270270
function uploadGetoffset($args)
271271
{

modules/api/library/KwUploadAPI.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,10 @@ function getOffset($args)
198198
{
199199
throw new Exception('Parameter '.self::PARAM_NAME_UPLOAD_TOKEN.' is not defined', -150);
200200
}
201-
$uploadToken = $args[self::PARAM_NAME_UPLOAD_TOKEN]; //XXX123.TMP
202-
203-
$offset = filesize($this->tmp_directory."/$uploadToken");
201+
$uploadToken = $args[self::PARAM_NAME_UPLOAD_TOKEN];
204202

205-
$data['offset'] = $offset;
203+
$data = array();
204+
$data['offset'] = filesize($this->tmp_directory."/$uploadToken");
206205

207206
return $data;
208207
}

0 commit comments

Comments
 (0)