forked from gitbot/uguu
Update upload.php
This commit is contained in:
parent
853b768036
commit
b1d3139a77
@ -17,8 +17,8 @@ function generateName($file)
|
|||||||
global $doubledots;
|
global $doubledots;
|
||||||
|
|
||||||
// We start at N retries, and --N until we give up
|
// We start at N retries, and --N until we give up
|
||||||
$tries = POMF_FILES_RETRIES;
|
$tries = UGUU_FILES_RETRIES;
|
||||||
$length = POMF_FILES_LENGTH;
|
$length = UGUU_FILES_LENGTH;
|
||||||
//Get EXT
|
//Get EXT
|
||||||
$ext = pathinfo($file->name, PATHINFO_EXTENSION);
|
$ext = pathinfo($file->name, PATHINFO_EXTENSION);
|
||||||
//Get mime
|
//Get mime
|
||||||
@ -99,7 +99,7 @@ function uploadFile($file)
|
|||||||
$newname = generateName($file);
|
$newname = generateName($file);
|
||||||
|
|
||||||
// Store the file's full file path in memory
|
// Store the file's full file path in memory
|
||||||
$uploadFile = POMF_FILES_ROOT.$newname;
|
$uploadFile = UGUU_FILES_ROOT.$newname;
|
||||||
|
|
||||||
// Attempt to move it to the static directory
|
// Attempt to move it to the static directory
|
||||||
if (!move_uploaded_file($file->tempfile, $uploadFile)) {
|
if (!move_uploaded_file($file->tempfile, $uploadFile)) {
|
||||||
@ -131,7 +131,7 @@ function uploadFile($file)
|
|||||||
return [
|
return [
|
||||||
'hash' => $file->getSha1(),
|
'hash' => $file->getSha1(),
|
||||||
'name' => $file->name,
|
'name' => $file->name,
|
||||||
'url' => POMF_URL.rawurlencode($newname),
|
'url' => UGUU_URL.rawurlencode($newname),
|
||||||
'size' => $file->size,
|
'size' => $file->size,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user