Posted by auroqn on October 21, 2007 at 3:07pm
Jump to:
| Project: | Upload previews |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
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:
<?php
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
#1
try this
$fileTempPath = file_check_upload('upload')-> filepath;echo '<br>'.$fileTempPath;
#2
OK need to review this patch for inclusion into the dev version.
Thanks
Robert
#3
this 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.
#4
Actually I think by design makes more since.
#5
print file_directory_temp();