I uploaded different documents to a folder and when I want to have uploaded files stored in the folder to be displayed on all web pages, how to write and delete them?
Don't have enough rep to comment. So, dropping an answer.
assuming you have not saved filenames in database.
you can make use of scandir()
you can read the manual for scandir() function here
and to delete you can use unlink()