douwen9343 2016-01-24 17:07
浏览 55

使用PHP显示上传的文件

I'm creating an interactive website where the user can upload a file.All I want to do is how can I let the other users see this file? For example if some datas are saved into database I can make this using SELECT and then print these data. But if I have a file how can I make this file to be seen only (not downloaded) from users? So I just want to know what can I use to make this and don't want you to make this for me! So please if anyone has an ide please tell what should I learn to make this? Is it possible to save the file in a database in phpMyAdmin and to select then? If yes which is the type of the field I should use to save the file so varchar?

  • 写回答

1条回答 默认 最新

  • dqb78642 2016-01-24 17:45
    关注

    It depends on how you want the file to be saved. If it's a text file I would go with text. If it's an image or some other kind of media I would pick blob. You can take a look at What are the differences between the BLOB and TEXT datatypes in MySQL? for more information on MySQL data types.

    Another approach would be to save the file somewhere outside the database (in a directory tree somewhere) and save a filepath to that location in a varchar column. Many DBMS do not support group by on blob or clob columns so that is something to consider if portability is an issue, and it adds a layer of separation between your data and file storage.

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计