phpcodeigniterlogistics

Upload naming convention


I'm creating a survey in which users can upload about 6 pictures. What would be the best way for me to store these in the file system? Users can do multiple surveys (thus tracking their improvement over time)...so that means I can't just name them sequentially...

This is a CI/PHP app. :)

Or for knowledge's sake, how would you do it?


Solution

  • Consider sequential numbering:

    user123_survey1_image6.jpg
    

    The ID of the user being 123, and this being the user's sixth image, or even more easily:

    user123_survey56_image899.jpg
    

    where user 123's sixth image happens to have the ID 899.