summaryrefslogtreecommitdiffstats
path: root/files/ajax/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'files/ajax/upload.php')
-rw-r--r--files/ajax/upload.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/files/ajax/upload.php b/files/ajax/upload.php
index af7a7acf702..b04796e3248 100644
--- a/files/ajax/upload.php
+++ b/files/ajax/upload.php
@@ -47,10 +47,10 @@ $result=array();
if(strpos($dir,'..') === false){
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
- $target=stripslashes($dir) . $files['name'][$i];
+ $target = OC_Helper::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i],$target)){
$meta=OC_FileCache::getCached($target);
- $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>$files['name'][$i]);
+ $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target));
}
}
OC_JSON::encodedPrint($result);