| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- /*
- *
- * Application Name: PHP Custom Content Uploader
- * Module Name: upload.php
- *
- * Copyright (c) 2020 DBMXPCA Technologies. All rights reserved.
- * https://www.dbmxpca.com/
- *
- */
- require_once($_SERVER['DOCUMENT_ROOT'] . "/core.php");
- /*
- *
- * This script is designed to be called with the following parameters:
- *
- * Parameter Description
- * -----------------------------------------------------------------
- * u Username, corresponding to the user's name in the "users.json" file. Value may not be empty. Case-sensitive.
- * k API Key, corresponding to the user's "key" value in the "users.json" file. Value may not be empty. Not case-sensitive by default but can be changed in "config.php".
- *
- */
- // Check user authorization.
- $err = null;
- if (CHECK_USER($err)){
-
- // Check image prelim data.
- $err = null;
- if (CHECK_IMAGE_PRELIM_DATA($err)){
-
- $err = null;
- if (CHECK_IMAGE_ERRORS($err)){
-
- // Attempt to create user's directory within UCD.
- if (CREATE_USER_CONTENT_DIR($_REQUEST['u'])){
-
- //echo "ok";
- SAVE_IMAGE($_REQUEST['u'], $_FILES['image']['type'], $_FILES['image']['tmp_name']);
-
-
-
- }
-
- else{
-
- $err = "500_1";
- DIE_ERR($err);
- }
- }
- else{
-
- DIE_ERR($err);
- }
- }
- else{
-
- DIE_ERR($err);
- }
- }
- else{
-
- DIE_ERR($err);
- }
|