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

208
Visualizações
How to get the names of files from another folder on my XAMPP server with JS

Im building a photo album application where when you upload a picture it gets saved in a photos directory of my XAMPP server. Now I need to access the names of the files of those photos from the photos directory so that I can show them again. How to do this with javascript?

<?php 
    if(isset($_FILES['image'])){
        $error = arraY();
        $file_name = $_FILES['image']['name'];
        $file_size = $_FILES['image']['size'];
        $file_tmp = $_FILES['image']['tmp_name'];
        $file_type = $_FILES['image']['type'];
        $hello = explode('.',$_FILES['image']['name']);
        $hello2 = end($hello);
        $file_ext = strtolower($hello2);
        $extensions = array('jpeg','jpg','png');
        if(in_array($file_ext,$extensions)==false){
            $error[] = "Please choose the image which has the extension as jpeg,jpg,png";
        }
        if(empty($error) == true){
            move_uploaded_file($file_tmp,"images/".$file_name);

        }
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h3>Image Upload</h3>
    <form action="album.php" method="POST" enctype="multipart/form-data" id="form">
        <input type="file" name="image" id="image">
        <input type="submit" value="Upload">
    </form>
    <ul class="photoalbum"></ul>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
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