I'm using the function move_uploaded_file
The first time I use it, I send a certain video to a temporary folder.
1
move_uploaded_file($_FILES['cadVideo']['tmp_name'], "temporario/" . 'temp-'.$_FILES['cadVideo']['name']);
Works perfectly!
Okay! After that, I perform some other assignments and functions and again need to use move_uploaded_file
. It turns out that at this second point it does not work anymore.
2
move_uploaded_file($_FILES['cadVideo']['tmp_name'], "../../Aulas/{$sessao[0]}/{$sessao[1]}/{$sessao[2]}/".$_FILES['cadVideo']['name']);
At first I thought it might be some directory-related error or something, so I reviewed it and found that it was not the error. But it still did not work.
For testing purposes I copied and pasted the same (1) role and put it in the place of (2) and to my surprise it did not work either.
>I was intrigued by this, how can a function that works normally does not work again a few lines of code afterwards?
Does move_uploaded_file work only once in the file? If so, how can I avoid this problem?