0

So, my hosting service has a limit of INODES on my server (index nodes). Each directory/file = 1 INODE. This might be a problem in the future as I want to implement file-sharing into my website. Couldn't I theoretically store the data of files into a MySQL database, then pull the data when a user requests a download? If this is possible, how would I do this in PHP?

A MySQL Skeleton:

TABLE: Files
ROWS: id, filename, data
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • How many files are you hosting? Some hosts disallow file sharing sites expressly in their TOS. It is worth investigating. – Alec Gorge Sep 13 '11 at 22:17
  • 3
    If you're storing so many files that you're going to break your INODE limit, I can guarantee you that your mysql database of files will probably break some other rule as well. – Cyclone Sep 13 '11 at 22:18
  • What kind of a limit? How many? – Pekka Sep 13 '11 at 22:18
  • It's against my TOS, oh well :( –  Sep 13 '11 at 22:23

1 Answers1

3

Don't start storing stuff in the database just because of a restriction like this - there are serious downsides to the approach.

If you really expect your numbers to exceed what the provider allows anytime soon, change providers and/or rent a private server.

Most of the things discussed in this famous SO question:

Storing Images in DB - Yea or Nay?

apply to all file formats.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088