PHP - 拒绝文件夹访问没有直接链接到文件?

I am creating a file hosting website. I would not like people to access the directory

public_html/quick/files

unless they have a direct download link from uploading a file. How would I go about this?

For others: To rephrase, deny permission to index all the files.

Create a file named .htaccess in public_html folder with this content:

Options -Indexes

Creates a blank index.html file in the directories.

If thought necessary, create a redirect to an error page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=<URL_ERROR_PAGE>"></HEAD>
<BODY>
    Optional page text here.
</BODY>
</HTML>