试图用PHP重命名两个文件

I'm using Ubuntu 12.04, apache2 + nginx (ISPManager)

My server works with Wowza Media Server, and that server put my recorded .flv videos in {root-of-the-server}/movies

I recieve the name of video from $_GET['rfile'] of the action: $this->request->get('rfile').

The file is created in the folder successfully, I locate it in two ways:

file_get_contents('http://<ip, which sends to {root-of-the-server}>/movies/'.$this->request->get('rfile'));

or

`find /movies/ -name $rfile`;

To upload my rec videos from the Wowza folder to web-site, I'm trying to rename the file after the recording is stopped:

From
'{root-of-the-server}/movies/$this->request->get('rfile').flv'
To
'.$_SERVER['DOCUMENT_ROOT'].'/upload/resume/resume'.$item['id'].'.flv'

I use $_SERVER['DOCUMENT_ROOT'], because I need to move the recorded videos automatically, and on the several websites.

Note: I don't put the {root-of-the-server} in my actual script, that's just a placeholder for posting here.

I'm trying to rename this with PHP.
First try:
shell_exec('mv /movies/'.$this->request->get('rfile').''.$_SERVER['DOCUMENT_ROOT'].'/upload/resume/resume'.$item['id'].'.flv');
Second try:
mv /movies/$rfile /movies/ok-just-rename-it-plz.flv
Third try:
rename('http://95.183.8.96:81/'.$this->request->get('rfile'), 'http://95.183.8.96:81/'.$item['id'].'.flv');
Fourth try:
rename('/movies/'.$this->request->get('rfile'), '/upload/resume/resume'.$item['id'].'.flv');

However none of these attempts worked. How can I rename these two files with a http wrapper? Or how can I rename them in another way?

查看全部
douyuai8994
douyuai8994
2015/09/07 12:36
  • rename
  • wowza
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复