Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
open file and download does not work in ubuntu

i complete my code on windows xampp to download text(or other file) file and its work good but when i upload the code on ubuntu server its does not work can you help me plz

$file = "$username.rsc";
$txt = fopen($file, "w") or die("Unable to open file!");
fwrite($txt,
"{
anything
}

");
fclose($txt);

header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.basename($file));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
  ob_clean();
    flush();
header('Content-Length: ' . filesize($file));
header("Content-Type: text/plain");
readfile($file);

the response on ubuntu is Unable to open file!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This sounds like a permissions issue. Make sure that your Apache user and group has access to the file and directory that you are trying to modify.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda