Commit 06f017badb64dd71318165467088cb966da1e829
Committed by
jpbauer
1 parent
6ad0ca11
Added a random portion to the temporary filename in file uploads, since uploads …
…failed if more than one file happened to upload in the same second due to a naming conflict Committed by: Serge Meunier Reviewed by: Jarrett Jordaan
Showing
1 changed file
with
1 additions
and
1 deletions
ktwebservice/KTUploadManager.inc.php
| @@ -201,7 +201,7 @@ class KTUploadManager | @@ -201,7 +201,7 @@ class KTUploadManager | ||
| 201 | { | 201 | { |
| 202 | $filename=basename($filename); | 202 | $filename=basename($filename); |
| 203 | $now=date('Y-m-d H:i:s'); | 203 | $now=date('Y-m-d H:i:s'); |
| 204 | - $now_str=date('YmdHis'); | 204 | + $now_str=date('YmdHis') + rand(0, 32768); |
| 205 | 205 | ||
| 206 | // Ensure the temp directory exists otherwise an error is thrown. | 206 | // Ensure the temp directory exists otherwise an error is thrown. |
| 207 | if (realpath($this->temp_dir) == FALSE) { | 207 | if (realpath($this->temp_dir) == FALSE) { |