Skip to content
Advertisement

Make directory and upload multiple file into created directory PHP

I have been digging for an answer for many days. how do i upload multiple file to the newly created directory. If you look into file_upload.php you will find two $upload_dir variable. So, let’s call first $upload_dir as direct folder and Second, $upload_dir as make dir. Simple

So, When I select first $upload_dir it does upload all files directly into the folder and When I select second $upload_dir what it does is create a random folder but unable to upload any file.

I want to upload multiple file into newly created folder

I did refer this PHP – Upload multiple photos into newly created Directory and Multiple file upload and store them in a directory but didn’t work for me

index.php

JavaScript

file_upload.php

JavaScript

Please Help!

Thank you in Advance

Advertisement

Answer

mkdir returns a boolean (true or false), not the created directory path.

You probably want to define the path in $upload_dir but not assign the result of the mkdir to it:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement