0

I am creating a website that let the users to upload their images, i planned to create a directory for every user so that user upload their images to their directory and their paths are stored in MySQL database.

This is the structure for John which saves the data in three different sub-directories and john directory is the main directory.

John/                         - main directory where john image will store
  small/                         - sub-directory for small re-sized image 
  medium/                        - sub-directory for medium re-sized image 
  big/                           - sub-directory for Original re-sized image 

The problem that now i am thinking that i will face in the future is that what if the disk got full. How the new images will be stored in john's directory, is it the end of the line or should i use any other way of storing the images.

Thanks in advance.

I have tried this Image upload storage strategies but it also have some problems.

Community
  • 1
  • 1
ARA
  • 83
  • 10
  • First off, I hardly see this as a programming issue as you are asking for "how to solve this / recommend me ways do this". THAT said, when you run out of storage I figure you have a couple of options, delete some old images, add more storage (online or another HDD). Or simply that each time a new image is uploaded the oldest image is deleted. (A tad similar to cleaning out some files) – Epodax Jul 09 '15 at 06:34
  • @Epodax, i don't want to delete image. – ARA Jul 09 '15 at 07:41
  • Then you have to add more storage, either in the form of cloud storage or another hard disk. – Epodax Jul 09 '15 at 07:55
  • @Epodax, that might be a good idea. – ARA Jul 09 '15 at 08:08
  • If you don't want to delete your images you don't really have any other options.. I mean sure, you can delay the need to get more storage by zipping and compressing your images, but at some point you'll need more storage. – Epodax Jul 09 '15 at 08:09

0 Answers0