[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16126]
From: |
nelson . guerra |
Subject: |
[Fmsystem-commits] [16126] |
Date: |
Fri, 30 Dec 2016 22:44:17 +0000 (UTC) |
Revision: 16126
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16126
Author: nelson224
Date: 2016-12-30 22:44:17 +0000 (Fri, 30 Dec 2016)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/property/inc/class.multiuploader.inc.php
Modified: branches/dev-syncromind-2/property/inc/class.multiuploader.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.multiuploader.inc.php
2016-12-30 22:43:57 UTC (rev 16125)
+++ branches/dev-syncromind-2/property/inc/class.multiuploader.inc.php
2016-12-30 22:44:17 UTC (rev 16126)
@@ -348,4 +348,42 @@
return $this->generate_response($response,
$print_response);
}
+ public function generate_response($content, $print_response =
true) {
+ $this->response = $content;
+
+ if ($print_response)
+ {
+ $content_files =
scandir($this->options['upload_dir']);
+ $count_files = 0;
+ foreach($content_files as $key => $value)
+ {
+ $path =
realpath($this->options['upload_dir'].'/'.$value);
+ if(is_file($path))
+ {
+ $count_files ++;
+ }
+ }
+ $content['num_files'] = $count_files;
+
+ $json = json_encode($content);
+ $redirect =
stripslashes($this->get_post_param('redirect'));
+ if ($redirect &&
preg_match($this->options['redirect_allow_target'], $redirect)) {
+ $this->header('Location:
'.sprintf($redirect, rawurlencode($json)));
+ return;
+ }
+ $this->head();
+ if
($this->get_server_var('HTTP_CONTENT_RANGE')) {
+ $files =
isset($content[$this->options['param_name']]) ?
+
$content[$this->options['param_name']] : null;
+ if ($files && is_array($files) &&
is_object($files[0]) && $files[0]->size) {
+ $this->header('Range: 0-'.(
+
$this->fix_integer_overflow((int)$files[0]->size) - 1
+ ));
+ }
+ }
+ $this->body($json);
+ }
+ return $content;
+ }
+
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16126],
nelson . guerra <=