Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda