summaryrefslogtreecommitdiffstats
path: root/files/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'files/ajax')
-rw-r--r--files/ajax/scan.php16
-rw-r--r--files/ajax/upload.php2
2 files changed, 17 insertions, 1 deletions
diff --git a/files/ajax/scan.php b/files/ajax/scan.php
new file mode 100644
index 00000000000..dec949a819b
--- /dev/null
+++ b/files/ajax/scan.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once '../../lib/base.php';
+
+$force=isset($_GET['force']) and $_GET['force']=='true';
+$checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
+
+//create the file cache if necesary
+if($force or !OC_FileCache::inCache('')){
+ if(!$checkOnly){
+ OC_FileCache::scan('');
+ }
+ OC_JSON::success(array("data" => array( "done" => true)));
+}else{
+ OC_JSON::success(array("data" => array( "done" => false)));
+} \ No newline at end of file
diff --git a/files/ajax/upload.php b/files/ajax/upload.php
index 5f0f68d9531..241edc216ff 100644
--- a/files/ajax/upload.php
+++ b/files/ajax/upload.php
@@ -47,7 +47,7 @@ if(strpos($dir,'..') === false){
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
$target=stripslashes($dir) . $files['name'][$i];
- if(OC_Filesystem::fromUploadedFile($files['tmp_name'][$i],$target)){
+ if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i],$target)){
$result[]=array( "status" => "success", 'mime'=>OC_Filesystem::getMimeType($target),'size'=>OC_Filesystem::filesize($target),'name'=>$files['name'][$i]);
}
}