You are here

function amazons3_file_create_object in AmazonS3 7.2

Create a file object.

Parameters

string $uri: The URI of the object to create.

Return value

\stdClass A file object suitable to use with file_save().

1 call to amazons3_file_create_object()
_amazons3_generate_image_style in ./amazons3.module
Generate an image style derivative and upload it to S3.

File

./amazons3.module, line 250
Hook implementations for the AmazonS3 module.

Code

function amazons3_file_create_object($uri) {
  $file = new stdClass();
  $file->fid = NULL;
  $file->uri = $uri;
  $file->filename = drupal_basename($uri);
  $file->filemime = file_get_mimetype($file->uri);
  $file->uid = 0;
  $file->status = 0;
  return $file;
}