Please anyone help me how to solve the following requirement using javascript and php.
when user upload(multiple file) any document we need to save that on the server, folder naming convention will be based on Year of date of birth (YYYY) and inside that (YYYY) folder will be a subfolder based on (MM) and then (DD) and then will be user Last name and inside that will be user first name. User will select type of the document i.e. assume "X, Y and Z"(Assume dropdown).
Create the file name on the server(Replace all the spaces with '~' and '/' with '!=')(File name will be yyyymmdd_lastname_firstname_documenttype.filetype), if a file already exists with same name use number(1,2,3,….) at the end. e..g if a User Andy Walkar's dob is July 2 1979 document xyz.pdf is uploaded. His file name on the server will be "1979_07_02_walkar_andy_X~.pdf" and file will be uploaded on in the folder "Docs\YYYY\MM\DD\LastName\FirstName"
I am able to do single file upload into a server folder which is already exists on the server. But I am unable to implement mutiple file upload in to a dynamic folder structure. Thanks in advance.
Sorry for my english.