forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.php
78 lines (69 loc) · 2.77 KB
/
upload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Uploading files from computer, step 1
* Shows the plupload form that handles the uploads and moves
* them to a temporary folder. When the queue is empty, the user
* is redirected to step 2, and prompted to enter the name,
* description and client for each uploaded file.
*/
require_once 'bootstrap.php';
$active_nav = 'files';
$page_title = __('Upload files', 'cftp_admin');
$page_id = 'upload_form';
$allowed_levels = array(9, 8, 7);
if (get_option('clients_can_upload') == 1) {
$allowed_levels[] = 0;
}
if (LOADED_LANG != 'en') {
$plupload_lang_file = 'vendor/moxiecode/plupload/js/i18n/' . LOADED_LANG . '.js';
if (file_exists(ROOT_DIR . DS . $plupload_lang_file)) {
add_asset('js', 'plupload_language', BASE_URI . '/' . $plupload_lang_file, '3.1.5', 'footer');
}
}
message_no_clients();
if (defined('UPLOAD_MAX_FILESIZE')) {
$msg = __('Click on Add files to select all the files that you want to upload, and then click continue. On the next step, you will be able to set a name and description for each uploaded file. Remember that the maximum allowed file size (in mb.) is ', 'cftp_admin') . ' <strong>' . UPLOAD_MAX_FILESIZE . '</strong>';
$flash->info($msg);
}
include_once ADMIN_VIEWS_DIR . DS . 'header.php';
?>
<div class="row">
<div class="col-12">
<script type="text/javascript">
$(function() {
$("#uploader").pluploadQueue({
runtimes: 'html5',
url: 'includes/upload.process.php',
chunk_size: '1mb',
rename: true,
dragdrop: true,
multipart: true,
filters: {
max_file_size: '<?php echo UPLOAD_MAX_FILESIZE; ?>mb'
<?php
if (!user_can_upload_any_file_type(CURRENT_USER_ID)) {
?>,
mime_types: [{
title: "Allowed files",
extensions: "<?php echo get_option('allowed_file_types'); ?>"
}]
<?php
}
?>
},
flash_swf_url: 'vendor/moxiecode/plupload/js/Moxie.swf',
silverlight_xap_url: 'vendor/moxiecode/plupload/js/Moxie.xap',
preinit: {
Init: function(up, info) {
//$('#uploader_container').removeAttr("title");
}
},
init: {}
});
});
</script>
<?php include_once FORMS_DIR . DS . 'upload.php'; ?>
</div>
</div>
<?php
include_once ADMIN_VIEWS_DIR . DS . 'footer.php';