Subversion-Projekte lars-tiefland.ci

Revision

Revision 2165 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2165 Revision 2382
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
Zeile 3... Zeile 3...
3
//$Id: UploadHandler.php 2165 2017-11-26 00:08:11Z lars $
3
//$Id: UploadHandler.php 2382 2018-10-05 17:34:39Z lars $
4
 
4
 
5
/*
5
/*
6
* jQuery File Upload Plugin PHP Class
6
* jQuery File Upload Plugin PHP Class
Zeile 111... Zeile 111...
111
				PHP_URL_SCHEME) . '://' . parse_url($this->get_server_var('HTTP_REFERER'),
111
				PHP_URL_SCHEME) . '://' . parse_url($this->get_server_var('HTTP_REFERER'),
112
				PHP_URL_HOST) . '/', // Trailing slash to not match subdomains by mistake
112
				PHP_URL_HOST) . '/', // Trailing slash to not match subdomains by mistake
113
				'/' // preg_quote delimiter param
113
				'/' // preg_quote delimiter param
114
				) . '/',
114
				) . '/',
115
			// Enable to provide file downloads via GET requests to the PHP script:
115
			// Enable to provide file downloads via GET requests to the PHP script:
116
			//     1. Set to 1 to download files via readfile method through PHP
116
			//	 1. Set to 1 to download files via readfile method through PHP
117
			//     2. Set to 2 to send a X-Sendfile header for lighttpd/Apache
117
			//	 2. Set to 2 to send a X-Sendfile header for lighttpd/Apache
118
			//     3. Set to 3 to send a X-Accel-Redirect header for nginx
118
			//	 3. Set to 3 to send a X-Accel-Redirect header for nginx
119
			// If set to 2 or 3, adjust the upload_url option to the base path of
119
			// If set to 2 or 3, adjust the upload_url option to the base path of
120
			// the redirect parameter, e.g. '/files/'.
120
			// the redirect parameter, e.g. '/files/'.
121
			'download_via_php' => false,
121
			'download_via_php' => false,
122
			// Read files in chunks to avoid memory limits when download_via_php
122
			// Read files in chunks to avoid memory limits when download_via_php
123
			// is enabled, set to 0 to disable chunked reading of files:
123
			// is enabled, set to 0 to disable chunked reading of files:
Zeile 1076... Zeile 1076...
1076
				} elseif (in_array($ext, $videos)) {
1076
				} elseif (in_array($ext, $videos)) {
1077
					$typ = 3;
1077
					$typ = 3;
1078
				}
1078
				}
1079
				$f = $GLOBALS["folder"];
1079
				$f = $GLOBALS["folder"];
1080
				$sql = "INSERT INTO
1080
				$sql = "INSERT INTO
1081
                        medien
1081
						medien
1082
                    SET
1082
					SET
1083
                        name='" . $fName . "',
1083
						name='" . $fName . "',
1084
                        folder='" . $f . "',
1084
						folder='" . $f . "',
1085
                        erstellt_am=UNIX_TIMESTAMP(),
1085
						erstellt_am=UNIX_TIMESTAMP(),
1086
                        erstellt_von='" . $_SERVER["PHP_AUTH_USER"] . "',
1086
						erstellt_von='" . $_SERVER["PHP_AUTH_USER"] . "',
1087
                        typ=" . $typ . "
1087
						typ=" . $typ . "
1088
                ";
1088
				";
1089
				$GLOBALS["ci"]->db->query($sql);
1089
				$GLOBALS["ci"]->db->query($sql);
1090
			} else {
1090
			} else {
1091
				$file->size = $file_size;
1091
				$file->size = $file_size;
1092
				if (!$content_range && $this->options['discard_aborted_uploads']) {
1092
				if (!$content_range && $this->options['discard_aborted_uploads']) {
1093
					unlink($file_path);
1093
					unlink($file_path);