PageRenderTime 38ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/ckeditor/plugins/_inactive/cyberim/includes/tasks/upload.php

https://bitbucket.org/seyar/parshin.local
PHP | 20 lines | 16 code | 1 blank | 3 comment | 2 complexity | e635025a5dab5d8a97bb2d4cae13cffa MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /*
  3. Защита от прямой загрузки
  4. */
  5. defined('ACCESS') or die();
  6. if (!empty($_FILES)) {
  7. $tempFile = $_FILES['Filedata']['tmp_name'];
  8. $targetPath = FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'].$_REQUEST['folder']);
  9. echo $_REQUEST['folder']."\n";
  10. $targetFile = $targetPath.$_FILES['Filedata']['name'];
  11. $fileTypes = explode('|', strtolower(Manager::$conf['filesystem.allowed_extensions']));
  12. $ext = FileManager::get_ext($_FILES['Filedata']['name']);
  13. if (in_array(strtolower($ext), $fileTypes)) {
  14. move_uploaded_file(FileManager::convertToFileSystem($tempFile), FileManager::convertToFileSystem($targetFile));
  15. chmod(FileManager::convertToFileSystem($targetFile), Manager::$conf['filesystem.file_chmod']);
  16. echo "1";
  17. }
  18. }
  19. ?>