Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

A while a go I had to developed a music site that allowed audio files to be uploaded to a site and then converted in to various formats using ffmpeg, people would then download the uploaded audio files after purchasing them and a tmp file would be created and placed at the download location and was only valid for each download instance and the tmp file would then get deleted.

Now I am revisiting the project, I have to add pictures and video as upload content also.

I want to find the best method for storing the files,

option 1 : storing the files in a folder and reference them in the database

option 2 : storing the actual file in the database(mysql) as blob.

I am toying around with this idea to consider the security implications of each method, and other issues I might have not calculated for.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
385 views
Welcome To Ask or Share your Answers For Others

1 Answer

See this earlier StackOverflow question Storing images in a database, Yea or nay?.

I know you mentioned images and video, however this question has relevance to all large binary content media files.

The consensus seems to be that storing file paths to the images on the filesystem, rather then the actual images is the way to go.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...