Welcome Guest, Not a member yet? Register   Sign In
rename folder
#1

[eluser]tfncruz[/eluser]
I'm trying to rename a folder using the php rename function like this:
Code:
if($autorNome != $this->input->post('nome')) {
    rename(base_url().'imgs/content/'.$autorNome, base_url().'imgs/content/'.$this->input->post('nome'));
    rename(base_url().'docs/'.$autorNome, base_url().'docs/'.$this->input->post('nome'));
}

php returns the following error:
Message: rename() [function.rename]: http wrapper does not support renaming

Is there any other way to rename a folder?

Thanks in advance!
#2

[eluser]davidbehler[/eluser]
I have never used that function before but I guess the problem simply is, that you don't use the relative path to the folder but use an url and that the function doesn't support urls as parameter.

Try using relative paths. Maybe something like this:
Code:
rename('./imgs/content/'.$autorNome, './imgs/content/'.$this->input->post('nome'));
#3

[eluser]tfncruz[/eluser]
waldmeister,
thank you very much!
Everything's working fine now!
#4

[eluser]Fribos[/eluser]
[quote author="waldmeister" date="1227293736"]I have never used that function before but I guess the problem simply is, that you don't use the relative path to the folder but use an url and that the function doesn't support urls as parameter.

Try using relative paths. Maybe something like this:
Code:
rename('./imgs/content/'.$autorNome, './imgs/content/'.$this->input->post('nome'));
[/quote]
Thanks!!!, you solved my problem




Theme © iAndrew 2016 - Forum software by © MyBB