How to secure access uploaded file on wordpress/PHP

Solution:

You can follow some steps like:

  1. Use random number with time stamp to save the file name.
  2. To prevent the folder from unauthorized access, disable directory listing using htaccess
  3. You can also deny all in htaccess so no one can access the folder
  4. Use plugin like Protect uploads to make more secure your upload folder, but they do the same things mentioned above.