Function __global->handle_upload_post_processing

Definitions

sources/uploads.php

  • Does post-processing of a new upload into the system.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$enforce_type integer No No required parameter N/A N/A The type of upload it is (bitmask, from CMS_UPLOAD_* constants)
$path PATH No No required parameter N/A N/A The disk path of the upload. Should be a temporary path that is deleted by the calling code
$upload_folder ID_TEXT No No required parameter N/A N/A The folder name in uploads/ where we would normally put this upload, if we weren't transferring it to the CDN
$filename string No No required parameter N/A N/A Filename to upload with. May not be respected, depending on service implementation
$obfuscate integer No No 0 N/A N/A Whether to obfuscate file names so the URLs can not be guessed/derived (a OBFUSCATE_* constant)
$accept_errors boolean No No False N/A N/A Whether to accept upload errors

Returns

  • URL on syndicated server (null: did not syndicate)
  • Type: ?URLPATH
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Does post-processing of a new upload into the system.
 *
 * @param  integer $enforce_type The type of upload it is (bitmask, from CMS_UPLOAD_* constants)
 * @param  PATH $path The disk path of the upload. Should be a temporary path that is deleted by the calling code
 * @param  ID_TEXT $upload_folder The folder name in uploads/ where we would normally put this upload, if we weren't transferring it to the CDN
 * @param  string $filename Filename to upload with. May not be respected, depending on service implementation
 * @param  integer $obfuscate Whether to obfuscate file names so the URLs can not be guessed/derived (a OBFUSCATE_* constant)
 * @param  boolean $accept_errors Whether to accept upload errors
 * @return ?URLPATH URL on syndicated server (null: did not syndicate)
 */

function handle_upload_post_processing(int $enforce_type, string $path, string $upload_folder, string $filename, int $obfuscate = 0, bool $accept_errors = false) : ?string