diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-15 17:30:07 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-15 17:34:53 +0200 |
commit | 8ecddb5bc311a7d9bb5def6783b8a71f09a8daa3 (patch) | |
tree | 4a5e65e7a31404ea5465f75d895b2bd95e93a77b /files/ajax | |
parent | 74ba09f95c57bc0cc8d7e8617cefe26f13054799 (diff) | |
download | nextcloud-server-8ecddb5bc311a7d9bb5def6783b8a71f09a8daa3.tar.gz nextcloud-server-8ecddb5bc311a7d9bb5def6783b8a71f09a8daa3.zip |
create a new filename when the uploaded file already exist
Diffstat (limited to 'files/ajax')
-rw-r--r-- | files/ajax/upload.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/files/ajax/upload.php b/files/ajax/upload.php index 76ea65fe933..b04796e3248 100644 --- a/files/ajax/upload.php +++ b/files/ajax/upload.php @@ -47,11 +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); |