Guest User

bitrix upload.php

a guest
Sep 2nd, 2016
487
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. define("STOP_STATISTICS", true);
  3. define("PUBLIC_AJAX_MODE", true);
  4. define("NO_KEEP_STATISTIC", "Y");
  5. define("NO_AGENT_STATISTIC","Y");
  6. define("DisableEventsCheck", true);
  7.  
  8. $siteId = (isset($_REQUEST['SITE_ID']) && is_string($_REQUEST['SITE_ID']) ? $_REQUEST['SITE_ID'] : '');
  9. $siteId = substr(preg_replace("/[^a-z0-9_]/i", "", $siteId), 0, 2);
  10. if($siteId != '')
  11. {
  12.     define("SITE_ID", $siteId);
  13. }
  14.  
  15. require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
  16. if ($_REQUEST["action"] == "uncloud")
  17. {
  18.     $loader = new \Bitrix\Main\UI\FileInputUnclouder();
  19.     $loader->setValue($_REQUEST["file"])->setSignature($_REQUEST["signature"])->exec($_REQUEST["mode"], array("width" => $_REQUEST["width"], "height" => $_REQUEST["height"]));
  20. }
  21. else if ($_REQUEST["action"] == "error")
  22. {
  23.     $errorCatcher = new \Bitrix\Main\UI\Uploader\ErrorCatcher();
  24.     $errorCatcher->log($_REQUEST["path"], $_REQUEST["data"]);
  25. }
  26. else
  27. {
  28.     $receiver = new \Bitrix\Main\UI\FileInputReceiver;
  29.     $receiver->setSignature($_POST["signature"])->exec();
  30. }
RAW Paste Data