Naming with file upload of multiple users

Discussion in 'Site Programming, Development and Design' started by Sankalp, Nov 28, 2018.

  1. I want the user to upload a picture.
    When this is done, it will be resized, for example, and made available to the user for download again.
    When uploading, the image is saved as a file on the server with a name.
    Exactly this filename is my problem. As long as one user loads something high after the other, the file could be named eg tmp.jpg.
    But what do I do if 2 or more users upload a picture at the same time?
    Is there something like a session id in ASP?
    And if so, how do I access it?
    Or how should such a thing generally be acted?

    You notice, I am quite new in the matter.
    Therefore, I am open to all tips and hints.

    Thank you
     
  2. ComputerMan

    ComputerMan Winhost Staff

    I'm not a developer but I think I understand what you want to do. What if you were to create a randomly generated number at the end of the file name when the image gets uploaded each time? for example tmp-231.jpg
     
    Michael likes this.
  3. Any easiest way to associate the temporary name with a timestamp???
     
  4. Elshadriel

    Elshadriel Winhost Staff

    Yes. By using string concatenation. Get a time stamp, convert that to a string and concatenate that at the end of the filename.
     
    Michael likes this.

Share This Page