SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist perpetual_dream's Avatar
    Join Date
    Nov 2005
    Location
    Jerusalem
    Posts
    542
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make sure the upload image has a unique file name

    Hello,

    I am thinking about creating a download website. Yet, I am not sure how can I give a unique file name for each uploaded software screenshot?

    Thanks
    Tanzeelnet - Best arabic downloadsite
    Linux Hosting |Free Downloads |

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Best bet is probably to store the images in a database, even if you end up putting in some disk caching. That way you don't have to worry about file name collisions, have some much more atomic backup options and keep things otherwise cleaner.

    If you want to skip the DB, you could always just save the files using, say, a GUID as the filename and use that to tie into a database with the rest of the details.

    Off Topic:

    Dear god, typing on a brand spanking new Thinkpad keyboard rocks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •