文件到MySQL [英] Files into MySQL

查看:67
本文介绍了文件到MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我被告知在MySQL中存储二进制文件

(如pdfs等)不是一个好主意,但在文件系统中。我在绝望中需要一个系统,我可以上传这样的二进制文件,分类

,为每个文件添加一些额外的信息,并列出/制作它们

可下载。 (列出和制作文件可以轻松下载

PHP)。

如果我将每个文件上传到Web服务器文件系统中的文件夹,那么

那么我可以将类别和一些

元数据等额外信息引用到我稍后列出的文件中吗?没有数据库=没有额外的

信息?

我需要一个人类可以理解的回答,因为我是一个真正的新手在
PHP和MySQL。希望是一个代码示例。如果有人可以提供帮助。

Ok, I have been told that it''s not a good idea to store binary files
(like pdfs etc.) in MySQL, but in the file system. I am in desperat
need of a system where I can upload binary files like this, categorize
them, add some extra info to each file, and list them/make them
downloadable. (listing and making files downloadable is easy with
PHP).
If I upload each file to a folder in the web server file system, how
is it then that I can refer extra information like a category and some
metadata to the files that I later will list? No database=no extra
info?
I need a human understandable answere, since I am a really newbie in
PHP and MySQL. Hopefully a code example. If someone could help.

推荐答案

消息ID:< 11 ************* *********@d57g2000hsg.googlegroups .comfrom

Nosferatum包含以下内容:
Message-ID: <11**********************@d57g2000hsg.googlegroups .comfrom
Nosferatum contained the following:

>如果我上传每个文件到Web服务器文件系统中的文件夹,然后我可以将类别和一些元数据等额外信息引用到我稍后列出的文件中?没有数据库=没有额外的
信息?
我需要一个人类可以理解的答案,因为我是PHP和MySQL的新手。希望是一个代码示例。如果有人可以帮忙。
>If I upload each file to a folder in the web server file system, how
is it then that I can refer extra information like a category and some
metadata to the files that I later will list? No database=no extra
info?
I need a human understandable answere, since I am a really newbie in
PHP and MySQL. Hopefully a code example. If someone could help.



数据库表最好,但你可以将信息存储为一个csv文件




-

Geoff Berrow(把猫放到电子邮件中)

它只是Usenet,没有人死。

我的意见,而不是我的委员会。

简单的RFD http://www.ckdog.co.uk/rfdmaker/


Nosferatum写道:
Nosferatum wrote:

好​​的,我被告知在MySQL中存储二进制文件

(如pdfs等)不是一个好主意,但在文件系统中。我在绝望中需要一个系统,我可以上传这样的二进制文件,分类

,为每个文件添加一些额外的信息,并列出/制作它们

可下载。 (列出和制作文件可以轻松下载

PHP)。

如果我将每个文件上传到Web服务器文件系统中的文件夹,那么

那么我可以将类别和一些

元数据等额外信息引用到我稍后列出的文件中吗?没有数据库=没有额外的

信息?

我需要一个人类可以理解的回答,因为我是一个真正的新手在
PHP和MySQL。希望是一个代码示例。如果有人可以提供帮助。
Ok, I have been told that it''s not a good idea to store binary files
(like pdfs etc.) in MySQL, but in the file system. I am in desperat
need of a system where I can upload binary files like this, categorize
them, add some extra info to each file, and list them/make them
downloadable. (listing and making files downloadable is easy with
PHP).
If I upload each file to a folder in the web server file system, how
is it then that I can refer extra information like a category and some
metadata to the files that I later will list? No database=no extra
info?
I need a human understandable answere, since I am a really newbie in
PHP and MySQL. Hopefully a code example. If someone could help.



您应该在MySQL新闻组中问这个问题 - 例如

comp.database.mysql。


但我还要补充一点 - 那些说实际上已经尝试过b $ b b的人怎么可能会尝试?我怀疑没有。我已经做了将近20年了它

工作正常。

-

========== ========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


You should really be asking this in a MySQL newsgroup - such as
comp.database.mysql.

But I will also add - how may of those people who say that have actually
tried? I suspect none. I have been doing it for almost 20 years and it
works fine.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Nosferatum写道:
Nosferatum wrote:

好​​的,我被告知存储二进制文件不是一个好主意

(如pdfs等)在MySQL中,但在文件系统中。我在绝望中需要一个系统,我可以上传这样的二进制文件,分类

,为每个文件添加一些额外的信息,并列出/制作它们

可下载。 (列出和制作文件可以轻松下载

PHP)。

如果我将每个文件上传到Web服务器文件系统中的文件夹,那么

那么我可以将类别和一些

元数据等额外信息引用到我稍后列出的文件中吗?没有数据库=没有额外的

信息?

我需要一个人类可以理解的回答,因为我是一个真正的新手在
PHP和MySQL。希望是一个代码示例。如果有人可以帮忙。
Ok, I have been told that it''s not a good idea to store binary files
(like pdfs etc.) in MySQL, but in the file system. I am in desperat
need of a system where I can upload binary files like this, categorize
them, add some extra info to each file, and list them/make them
downloadable. (listing and making files downloadable is easy with
PHP).
If I upload each file to a folder in the web server file system, how
is it then that I can refer extra information like a category and some
metadata to the files that I later will list? No database=no extra
info?
I need a human understandable answere, since I am a really newbie in
PHP and MySQL. Hopefully a code example. If someone could help.



我当然不是这里最好的编码器,但我的建议是

你创建一个表来存储关于文件和文件名

包括路径。您将文件保存到该路径并使用SQL查询

当您要访问该文件时提取路径名称。由你来决定文件名使用的
。在我自己的照片数据库中,我写的是我使用自动增加主键作为文件路径,因此

photo_id = 123456的缩略图位于/ data_dir / 1/2/3/4/5 / small.jpg。有人会比这更好的想法,但这个似乎适用于低使用率。


-
http://www.petezilla.co.uk


这篇关于文件到MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆