php - Uploadify: Wait for move_uploaded_file until firing "onUploadSuccess" -
i'm trying upload large video files via uploadify once files big (>800mb) onuploadsuccess event fires before move_uploaded_file
is done. there way make uploadify wait actual succes or display kind of waiting message bewteen finished upload , actual success (like "finishing upload" or something)?
here's code of upload.php:
if($video = wire('pages')->get($_post['id'])) { if (!empty($_files)) { $tempfile = $_files['filedata']['tmp_name']; $targetpath = $_server['document_root'] . $targetfolder; $targetfile = rtrim($targetpath,'/') . '/' . $_files['filedata']['name']; $targetfile = preg_replace('/ /','_',$targetfile); // validate file type $filetypes = array('mov','mp4','m4v'); // file extensions $fileparts = pathinfo($_files['filedata']['name']); if (in_array($fileparts['extension'],$filetypes)) { if(move_uploaded_file($tempfile,$targetfile)) { $file = preg_split("/\//", $targetfile); $video->filename = array_pop($file); $video->video_status = 'transcode'; $video->addstatus('page::statusunpublished'); $video->save(); echo $video->filename." gespeichert"; } } else { echo 'invalid file type.'; } } }
thanks,
thomas
Comments
Post a Comment