Contact: Lyubomir Arsov, liubo (at) web-lobby.com */ include '../system.inc.php'; include 'functions.inc.php'; verifyAction('UPLOAD'); checkAccess('UPLOAD'); $path = trim(empty($_POST['d']) ? getFilesPath() : $_POST['d']); verifyPath($path); $res = ''; if (is_dir(fixPath($path))) { if (!empty($_FILES['files']) && is_array($_FILES['files']['tmp_name'])) { $errors = $errorsExt = array(); foreach ($_FILES['files']['tmp_name'] as $k => $v) { $filename = $_FILES['files']['name'][$k]; $filename = RoxyFile::MakeUniqueFilename(fixPath($path), $filename); $filePath = fixPath($path) . '/' . $filename; if (!RoxyFile::CanUploadFile($filename)) { $errorsExt[] = $filename; } elseif (!move_uploaded_file($v, $filePath)) { $errors[] = $filename; } if (is_file($filePath)) { @chmod($filePath, octdec(FILEPERMISSIONS)); } if (RoxyFile::IsImage($filename) && (intval(MAX_IMAGE_WIDTH) > 0 || intval(MAX_IMAGE_HEIGHT) > 0)) { RoxyImage::Resize($filePath, $filePath, intval(MAX_IMAGE_WIDTH), intval(MAX_IMAGE_HEIGHT)); } } if ($errors && $errorsExt) { $res = getSuccessRes(t('E_UploadNotAll') . ' ' . t('E_FileExtensionForbidden'));
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Contact: Lyubomir Arsov, liubo (at) web-lobby.com */ include '../system.inc.php'; include 'functions.inc.php'; verifyAction('COPYFILE'); checkAccess('COPYFILE'); $path = trim(empty($_POST['f']) ? '' : $_POST['f']); $newPath = trim(empty($_POST['n']) ? '' : $_POST['n']); if (!$newPath) { $newPath = getFilesPath(); } verifyPath($path); verifyPath($newPath); if (is_file(fixPath($path))) { $newPath = $newPath . '/' . RoxyFile::MakeUniqueFilename(fixPath($newPath), basename($path)); if (copy(fixPath($path), fixPath($newPath))) { echo getSuccessRes(); } else { echo getErrorRes(t('E_CopyFile')); } } else { echo getErrorRes(t('E_CopyFileInvalisPath')); }