move_uploaded_file(): Unable to move

Asked

Viewed 1,677 times

0

foreach ($_FILES["inputfileSendTorrent"]["error"] as $key => $error) 
    {

        $arqName = $_FILES['inputfileSendTorrent']['name'][$i];
        $arqTemp = $_FILES['inputfileSendTorrent']['tmp_name'][$i];

        if(!@move_uploaded_file($arqTemp, $uploaddir.$arqName))
        {
            $error = error_get_last();
            echo $error['message'];
        }

        $i++;
    }

Returns this error move_uploaded_file(): Unable to move '/tmp/phpTeiKHq' to './arquivos/ZawabMNHXgvV/2MB'

Creating the folder

if(!@mkdir(DIR_ARQUIVOS.$chave, 777, true))
    {
            $error = error_get_last();
            echo $error['message'];
    }
  • the briefcase ./arquivos/ZawabMNHXgvV/ is there? You have written permission?

  • In linux environment always checks the permissioning of folders, returns us the permission that is

  • @Guilhermenascimento I gave permission 777 for the folder ./arquivos, but when I create the new folder, I don’t know with what permission it comes.

  • @How can I do that ??

  • There is no way to answer the question as we have no way to reproduce the problem, read this: http://answall.com/help/mcve

  • how you’re creating this folder?

  • @Thiagosantos I asked the question.

  • @Guilhermenascimento I already put the code of how I create the folder, I believe I can already reproduce.

  • Responded to, Lucas

Show 4 more comments

1 answer

3


Browser other questions tagged

You are not signed in. Login or sign up in order to post.