Question

i have a script that uploads images and then crops them. but when i use

    <input type="file" name="filename" multiple="multiple"/><br />

and then do a var_dump i only get 1 array instead of 'for example' 10 images.

My uploadform:

<form action="uploaded.php" method="POST" enctype="multipart/form-data">
    <hr>
    <input type="file" name="filename" multiple="multiple"/><br />
    <br /><br />
    <hr width="60" align="left">
    <input type="submit" value="Upload" />
</form>

My code to see the uploades files:

<?php
session_start();
echo "<pre>";
var_dump($_FILES);

die();
?>

when i upload 10 images. it only shows the first selected and prints out 1 array.

Please help!

Thanks

EDIT: i think that i have to use a session for this. but how do i do that?

Was it helpful?

Solution

Same as any other form element used more then once: <input type="file" name="filename[]" multiple="multiple"/>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top