mirror of
https://github.com/clitor-is-protocol/kevacoin-cli.git
synced 2025-01-31 00:44:18 +00:00
set namespace as basename
This commit is contained in:
parent
b1b6063dfa
commit
d5050d9901
13
cli/put.php
13
cli/put.php
@ -35,6 +35,17 @@ $md5file = md5_file(
|
||||
$argv[2]
|
||||
);
|
||||
|
||||
// Get file name
|
||||
$name = basename(
|
||||
$argv[2]
|
||||
);
|
||||
|
||||
// Check filename not longer of protocol
|
||||
if (mb_strlen($name) > 255)
|
||||
{
|
||||
$name = $md5file;
|
||||
}
|
||||
|
||||
// Split content to smaller parts, according to the protocol limits
|
||||
$size = isset($argv[3]) && $argv[3] <= 3072 ? (int) $argv[3] : 3072;
|
||||
|
||||
@ -66,7 +77,7 @@ $ns = _exec(
|
||||
sprintf(
|
||||
"%s '%s'",
|
||||
'keva_namespace',
|
||||
$md5file
|
||||
$name
|
||||
)
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user