java - 网站收费附件下载一般怎么做
阿神
阿神 2017-04-17 12:59:49
0
1
591

语言JAVA、数据库MySQL、系统CentOS

网站服务器:WEB服务器一
文件服务器:FILE服务器一、FILE服务器二、FILE服务器三、FILE服务器四...
数据库服务器:SQL服务器一

第一、用户上传附件应该是在 WEB服务器一 服务器,是不是用文件同步软件同步到其他所有 文件服务器
第二、用户下载控制,是不是在 文件服务器 也要部署写好的一个控制权限的网站去读取文件,数据库共用 数据库服务器 服务器

这是我现在的想法,感觉好复杂,一般是这么做吗?

一定要能控制知道地址后直接下载的情况

阿神
阿神

闭关修行中......

reply all(1)
Peter_Zhu

I feel the need for service-oriented development ideas

1,

You can place a verified upload.php on the file server, depending on what language you use, there are other methods. . . .

Then the user uploads the file to the web server, and the web server submits it to the file server

However, if it is a long-term plan, the upload function should be made into a service

2,

Make a jump link on the web server, such as:

http://www.xxxxxx.com/down?id=1234&userid=12345

Then add some other items such as timestamp based on id and userid to calculate a key

For example, use key = md5(id+userid+"sfasdfsfsdf"+12343423470)

Then jump to the file server

Also create a page like this on the file server to verify this key

http://file1.xxx.com/down?fileid=1234&securitykey=key&userid=&time=timestamp calculated above

Then use the stream to output the file to the user (do not expose the real path of the file to the browser, set the real file access permissions on the server)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template