public function MediaInternetFileHandler::postSave in D7 Media 7
Same name and namespace in other branches
- 7.4 modules/media_internet/includes/MediaInternetFileHandler.inc \MediaInternetFileHandler::postSave()
- 7.2 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') . '://';
$uri = file_stream_wrapper_uri_normalize($scheme . $file_obj->filename);
// Now to its new home.
$file_obj = file_move($file_obj, $uri, FILE_EXISTS_RENAME);
}