homepage Welcome to WebmasterWorld Guest from 54.237.98.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Advice on image uploading
SixTimesEight

5+ Year Member



 
Msg#: 3470083 posted 3:57 pm on Oct 5, 2007 (gmt 0)

I'm building a site which will allow users to upload images (CentOS/Apache/MySQL/PHP). The user will select an image to upload from their local machine then see a preview of the image and be prompted to select an area of the image for a thumbnail. Then both the full size and thumbnailed images will be saved to the server with a randomly generated 32 character filename (saved into mysql).

My testing site has all of the images being dumped into /image/uploads for full size images, and /image/uploads/thumbs for the thumbnails. After uploading quite a few test images I realized that I might have a scalability problem.

My initial thoughts on a better directory structure are this:
/image/uploads/%year%/%month%/%day%/
/image/uploads/thumbs/%year%/%month%/%day%/

Is this a solid solution or is there a better idea? Should I just continue to let them pile up in a single directory. Any advice would be appreciated.

 

your_store

10+ Year Member



 
Msg#: 3470083 posted 4:05 pm on Oct 5, 2007 (gmt 0)

I would segment by the filename..

For example, with a ten character filename 123456790.gif

/image/uploads/123/456/123456790.gif
/image/uploads/thumbs/123/456/123456790.gif

I definitely wouldn't keep throwing them in one directory though :)

SixTimesEight

5+ Year Member



 
Msg#: 3470083 posted 11:19 pm on Oct 5, 2007 (gmt 0)

Thanks. That seems logical enough and probably easier to manage. With a 32 character file name, how many levels deep should I take it though?

[edited by: SixTimesEight at 11:35 pm (utc) on Oct. 5, 2007]

your_store

10+ Year Member



 
Msg#: 3470083 posted 1:36 pm on Oct 8, 2007 (gmt 0)

It really depends on the number of files you're anticipating, but two levels should be more than enough.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved