public function MediaInternetFileHandler::postSave in D7 Media 7.2
Same name and namespace in other branches
- 7.4 modules/media_internet/includes/MediaInternetFileHandler.inc \MediaInternetFileHandler::postSave()
- 7 modules/media_internet/includes/MediaInternetFileHandler.inc \MediaInternetFileHandler::postSave()
- 7.3 modules/media_internet/includes/MediaInternetFileHandler.inc \MediaInternetFileHandler::postSave()
After the file has been saved, implementors may do additional operations.
Parameters
object $file_obj:
Overrides MediaInternetBaseHandler::postSave
File
- modules/
media_internet/ includes/ MediaInternetFileHandler.inc, line 30 - Definition of MediaInternetFileHandler.
Class
- MediaInternetFileHandler
- A class for managing the addition of Internet files.
Code
public function postSave(&$file_obj) {
$scheme = variable_get('file_default_scheme', 'public') . '://';
module_load_include('inc', 'file_entity', 'file_entity.pages');
$destination_uri = file_entity_upload_destination_uri(array());
$uri = file_stream_wrapper_uri_normalize($destination_uri . '/' . $file_obj->filename);
// Now to its new home.
$file_obj = file_move($file_obj, $uri, FILE_EXISTS_RENAME);
}