上传和下载文件PHP [英] Upload and download file PHP
问题描述
Hy我的大学有一个密码策略项目,几乎已经完成,但我不得不问一个问题。我做了注册,登录,配置文件和更新密码页面,但是现在我决定添加上传和下载文件选项,用户可以上传他/她的个人文件,如.doc或.pdf文件。
我想决定在用户个人资料页面上传和下载文件选项。在那个项目中我使用php,mysql等。
所以我的问题是如果我在用户配置文件页面上添加上传和下载文件选项我必须只使用php或php / mysql两者,来实现上传并在用户个人资料页面下载文件。
我尝试过:
我做了一个简单的注册,使用php / mysql登录应用程序
Hy I have a password policy project from my university which is almost complete but I have to ask a question. I made sign up, login, profile and renew password page which work very well but now I have decides to add upload and download file option where user can upload his/her personal file like .doc or .pdf file.
I want to decide to upload and download file option on user profile page. In that project I use php, mysql and other.
So my question is if I add upload and download file option on user profile page I have to use php only or php/mysql both, to implement upload and download file on user profile page.
What I have tried:
I made a simple sign up, login application using php/mysql
推荐答案
只需上传文件就需要使用PHP。
但是为了维护关于文件的信息,你需要MySQL。
例如,对于一个学生,学生ID 1和他或她上传ProjectFile.pdf
然后你需要上传一个文件在一个独特的位置(替代你可以重命名文件)与数据库中的以下信息
1.学生ID:1
2.文件路径:../Assets / Upload /< ;一些随机字符串> /ProjectFile.pdf
3.文件名:ProjectFile.pdf
现在从MySQL下载扫描文件标签les。
获取最终用户的文件路径和开始下载文件。
我希望我能够解析您的查询。
For uploading file only you need to use PHP.
But for maintaining information regarding file u need MySQL.
For example for one student the Student Id 1 and he or she uploading a ProjectFile.pdf
then you need to upload a file in a unique location (alternative you can rename file) with following information in database
1. StudentID : 1
2. FilePath : ../Assets/Upload/<Some Random String>/ProjectFile.pdf
3. FileName : ProjectFile.pdf
Now at the time of download scan file from MySQL Tables.
Get the File Path and Start Download file for End User.
I hope i am able to resolve your query.
在此处查看答案:文件上传和下载Php [ ^ ]
这里:使用PHP上传文件到MySQL数据库 - PHP [ ^ ]
See answer here: File upload and Download in Php[^]
And here: Uploading files into a MySQL database using PHP - PHP[^]
这篇关于上传和下载文件PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!