Closed (works as designed)
Project:
Upload previews
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2007 at 15:07 UTC
Updated:
3 Jan 2012 at 10:13 UTC
Hi,
I need to get temporary path for my uploaded file. I'm trying to make simple .mov preview for upload preview module, but i'm not able to get the correct temporary path for uploaded file so i can embed it. here is simple code:
function upload_preview_upload_preview($file) {
// Only check for images
if (strpos($file->filemime, 'image/') === 0) {
.......
}
// my code starts here
if(strpos($file->filemime, 'video/quicktime') === 0) {
//this is critical, i believe this is not correct, i only need to get this $path...
$path =$_FILES["files"]["tmp_name"][$file->filename];
if ($path) {
return array(
'#type' => 'upload_preview_mov',
'#value' => file_create_url($path),
);
}
}
}
//movie embed
function theme_upload_preview_mov($element) {
$mov ='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="150" width="150"> ';
$mov .='<param name="src" value="'.$element['#value'].'">';
$mov .='<param name="autoplay" value="false">';
$mov .='<param name="type" value="video/quicktime" height="150" width="150">';
$mov .='<embed src="'.$element['#value'].'" height="150" width="150" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">';
$mov .='</object>';
return $mov;
}
Comments
Comment #1
sonofkc commentedtry this
Comment #2
rmiddle commentedOK need to review this patch for inclusion into the dev version.
Thanks
Robert
Comment #3
rmiddle commentedthis isn't really a patch as more someone asking how to do something that was answerned long ago. I am going to make this wont fix.
Comment #4
rmiddle commentedActually I think by design makes more since.
Comment #5
wszxg8866 commentedprint file_directory_temp();