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

165
Visualizações
how to find the length of the text file which user uploads

Guide me to find the number of characters which are present in the text file which i upload. This code will display the characters which are present in the .txt file`

<!DOCTYPE html>
<html>
    <head>
        <title>File Reader</title>
    </head>
    <body>
        <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
            <input type="file" name="file" size="60" accept=".txt" />
            <input type="submit" value="Show Contents" />
        </form>
        <?php
            if ($_FILES) {

                    $fileName = $_FILES['file']['tmp_name'];

                    $file = fopen($fileName, "r");

                    while (!feof($file)) {
                        echo fgets($file) . "";
                    }

                    while (!feof($file)) {
                        echo fgetc($file);
                    }
                    fclose($file);
                }
        ?>
    </body>
</html>
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You could use

$_FILES['userfile']['size']

this give you the size, in bytes, of the uploaded file.

http://www.php.net/manual/en/features.file-upload.post-method.php

over 4 years ago · Santiago Trujillo 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