function _video_upload_get_path in Video 6
Same name and namespace in other branches
- 5 types/video_upload/video_upload.module \_video_upload_get_path()
- 6.2 types/video_upload/video_upload.module \_video_upload_get_path()
Gets the definitive path for stored videos
1 call to _video_upload_get_path()
- _video_upload_store_file in types/
video_upload/ video_upload.module - Move a temp file into the final directory associating it with the node
File
- types/
video_upload/ video_upload.module, line 510 - video.module
Code
function _video_upload_get_path(&$file, &$node) {
// this code is from uploadpath.module
$file_name = str_replace(array(
' ',
"\n",
"\t",
), '_', token_replace(variable_get('video_upload_path_prefix', 'videos') . '/', 'node', $node)) . $file->filename;
// Create the directory if it doesn't exist yet.
$dirs = explode('/', dirname($file_name));
$directory = file_directory_path();
while (count($dirs)) {
$directory .= '/' . array_shift($dirs);
file_check_directory($directory, FILE_CREATE_DIRECTORY);
}
$file->filename = $file_name;
}