flowjs / flow-php-server

flow.js php server library, validates uploaded chunks and safely merges all chunks to a single file
http://flowjs.github.io/ng-flow/
MIT License
243 stars 44 forks source link

Handle Duplicate File Name #9

Closed prionkor closed 9 years ago

prionkor commented 9 years ago

The script currently overwrites if there is an identically named file in the final upload directory. It should be able to rename the file (numbered perhaps like filename-2.ext) if it encounters this kinds of situation.

AidasK commented 9 years ago

This can't be handled by the library. Instead you should generate unique file names by yourself. On every upload request user sends you a unique identifier for each file. You can combine identifier in the request, user ip, user id and maybe php "uniqid" for uniqueness.