You are here

function file_resup_upload_id in File Resumable Upload 8

Same name and namespace in other branches
  1. 7 file_resup.module \file_resup_upload_id()

Get a valid upload ID from a resup file ID.

2 calls to file_resup_upload_id()
file_resup_save_upload in ./file_resup.module
Save a completed upload.
file_resup_upload in ./file_resup.module
Menu callback to upload a file chunk.

File

./file_resup.module, line 452

Code

function file_resup_upload_id($resup_file_id) {
  global $user;
  if (preg_match('`^[1-9]\\d*-\\d+-[\\w%]+$`', $resup_file_id)) {
    $prefix = $user->uid ? $user->uid : str_replace('.', '_', $user->hostname);
    return substr($prefix . '-' . $resup_file_id, 0, 240);
  }
  return FALSE;
}