upload.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /*
  3. *
  4. * Application Name: PHP Custom Content Uploader
  5. * Module Name: upload.php
  6. *
  7. * Copyright (c) 2020 DBMXPCA Technologies. All rights reserved.
  8. * https://www.dbmxpca.com/
  9. *
  10. */
  11. require_once($_SERVER['DOCUMENT_ROOT'] . "/core.php");
  12. /*
  13. *
  14. * This script is designed to be called with the following parameters:
  15. *
  16. * Parameter Description
  17. * -----------------------------------------------------------------
  18. * u Username, corresponding to the user's name in the "users.json" file. Value may not be empty. Case-sensitive.
  19. * 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".
  20. *
  21. */
  22. // Check user authorization.
  23. $err = null;
  24. if (CHECK_USER($err)){
  25. // Check image prelim data.
  26. $err = null;
  27. if (CHECK_IMAGE_PRELIM_DATA($err)){
  28. if (CHECK_IMAGE_ERRORS($err)){
  29. echo "ok";
  30. }
  31. else{
  32. DIE_ERR($err);
  33. }
  34. }
  35. else{
  36. DIE_ERR($err);
  37. }
  38. }
  39. else{
  40. DIE_ERR($err);
  41. }