Ok, I am not a professional in PHP as I am more on front-end than back-end. I want to know some information of file upload in PHP. I did create a website as a project where users can upload images, with its security and validation. The images stored in a folder. It was good. However, I have not tried other things with file upload, so here are my questions:
1/ When I did the image upload system, I used the $FILES function, name, size and tmp_name. Then I checked the image formats with regular expression. I want to know, will this be applied on any file formats like docx, pdf, mp3, rar, zip etc? I mean if I want to let users upload any file format, is the procedure the same?
2/ I am not going to use database. The files uploaded will be in a folder. Before upload, the user can choose a period when the file will be deleted. For example, the user can chose 3 days, 1 week and 1 month for the file to be deleted automatically. Can we do this in PHP? If yes, how it works? Well, I am not asking for codes here, but you can expain me. Suppose the user chooses 3 days in a drop dow list, how to proceed the algorithm for the uploaded file to be deleted automatically from the folder in 3 days?