mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 04:50:47 -07:00
reverting back chunked upload feature
This commit is contained in:
parent
c042fa2689
commit
9a9dabb0c9
2 changed files with 28 additions and 5 deletions
|
@ -147,7 +147,6 @@
|
||||||
var url = '/upload/';
|
var url = '/upload/';
|
||||||
$('#file_upload_' + letter).fileupload({
|
$('#file_upload_' + letter).fileupload({
|
||||||
singleFileUploads: false,
|
singleFileUploads: false,
|
||||||
maxChunkSize: 10000000, // ~10 MB
|
|
||||||
add: function (e, data) {
|
add: function (e, data) {
|
||||||
FM.setTabActive(FM['TAB_'+letter]);
|
FM.setTabActive(FM['TAB_'+letter]);
|
||||||
|
|
||||||
|
|
|
@ -469,7 +469,7 @@ class UploadHandler
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function sanitizeFileName($file) {
|
protected function sanitizeFileName($file) {
|
||||||
// (|\\?*<\":>+[]/')
|
// (|\\?*<\":>+[]/')
|
||||||
// \|\\\?\*\<\"\'\:\>\+\[\]
|
// \|\\\?\*\<\"\'\:\>\+\[\]
|
||||||
|
@ -560,6 +560,25 @@ class UploadHandler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function get_current_file_name($file_path, $name, $size, $type, $error,
|
||||||
|
$index, $content_range) {
|
||||||
|
|
||||||
|
$name = $this->trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->get_unique_filename(
|
||||||
|
$file_path,
|
||||||
|
$this->fix_file_extension($file_path, $name, $size, $type, $error,
|
||||||
|
$index, $content_range),
|
||||||
|
$size,
|
||||||
|
$type,
|
||||||
|
$error,
|
||||||
|
$index,
|
||||||
|
$content_range
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function handle_form_data($file, $index) {
|
protected function handle_form_data($file, $index) {
|
||||||
// Handle form data, e.g. $_REQUEST['description'][$index]
|
// Handle form data, e.g. $_REQUEST['description'][$index]
|
||||||
}
|
}
|
||||||
|
@ -1079,8 +1098,13 @@ class UploadHandler
|
||||||
$index = null, $content_range = null) {
|
$index = null, $content_range = null) {
|
||||||
|
|
||||||
$file = new \stdClass();
|
$file = new \stdClass();
|
||||||
$file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,
|
// $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,
|
||||||
$index, $content_range);
|
// $index, $content_range);
|
||||||
|
|
||||||
|
$file->name = $this->trim_file_name($uploaded_path, $name, $size, $type, $error, $index, $content_range);
|
||||||
|
$file->name = $this->fix_file_extension($uploaded_path, $name, $size, $type, $error, $index, $content_range);
|
||||||
|
|
||||||
|
|
||||||
$file->size = $this->fix_integer_overflow(intval($size));
|
$file->size = $this->fix_integer_overflow(intval($size));
|
||||||
$file->type = $type;
|
$file->type = $type;
|
||||||
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
||||||
|
@ -1103,7 +1127,7 @@ class UploadHandler
|
||||||
} else {
|
} else {
|
||||||
chmod($uploaded_file, 0644);
|
chmod($uploaded_file, 0644);
|
||||||
// move_uploaded_file($uploaded_file, $file_path);
|
// move_uploaded_file($uploaded_file, $file_path);
|
||||||
exec (VESTA_CMD . "v-copy-fs-file ". USERNAME ." {$uploaded_file} {$file_path}", $output, $return_var);
|
exec (VESTA_CMD . "v-copy-fs-file ". USERNAME ." {$uploaded_file} '{$file_path}'", $output, $return_var);
|
||||||
|
|
||||||
$error = check_return_code($return_var, $output);
|
$error = check_return_code($return_var, $output);
|
||||||
if ($return_var != 0) {
|
if ($return_var != 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue