In a website how can the server make sure uploaded files wont have the same name.

This is a discussion on In a website how can the server make sure uploaded files wont have the same name. within the Tech Board forums, part of the Community Boards category; I was reading this question on stackoverflow and wonder, what does the server do when a user uploads a file ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    122

    In a website how can the server make sure uploaded files wont have the same name.

    I was reading this question on stackoverflow and wonder, what does the server do when a user uploads a file that's name is already used? For example in Facebook I'm sure 1000s of people uploaded a profile picture named profilepic.jpg

  2. #2
    Registered User
    Join Date
    May 2012
    Location
    Bonn, Germany
    Posts
    16
    Of course those files are renamed on the server.
    In the simplest case, each file just gets a unique ID which is an increasing number: 1.jpg, 2.jpg, 3.jpg, ...
    But probably they use some kind of hashing to generate the filename.

    ___________
    Visit my project: Symbolic calculator for function derivatives

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is there an irc server/channel for this website?
    By ferfy in forum General Discussions
    Replies: 9
    Last Post: 11-09-2011, 08:13 PM
  2. i want to make super user friendly website creater tool
    By Anddos in forum Windows Programming
    Replies: 10
    Last Post: 12-06-2008, 01:19 PM
  3. Files wont zip into exe
    By smarta_982002 in forum C Programming
    Replies: 3
    Last Post: 02-19-2008, 03:19 PM
  4. 4.24 MB in attachments uploaded
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 03-18-2005, 02:33 PM
  5. files > 65535 bytes wont read in dos
    By Pharoh in forum C Programming
    Replies: 4
    Last Post: 11-11-2003, 11:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21