target = $targetURL;
}
public function getTarget() {
return $this->target;
}
public function getCode(array $param = array()) {
$base = _COMURL_ . '/html/mcms/upload/jupload/_bin_';
$maxsize = trim(ini_get('upload_max_filesize'));
$last = strtolower($maxsize[strlen($maxsize) - 1]);
switch($last) {
case 'g':
$maxsize *= 1024;
case 'm':
$maxsize *= 1024;
case 'k':
$maxsize *= 1024;
}
/*
other known parameters
----------------------
language: de
country:
afterUploadURL: null
allowHttpPersistent: false
allowedFileExtensions: null
browsingDirectory (current value): null
debugLevel: 100
(debugfile: D:\Users\kiu345\AppData\Local\Temp\jupload_7278030391554327573_log.txt)
fileChooserIconFromFileContent: 0
fileChooserIconSize: 20
fileFilterName: null
filenameEncoding: null
formdata: null
ftpCreateDirectoryStructure: false
ftpTransfertBinary: true
ftpTransfertPassive: true
httpUploadParameterName: File
httpUploadParameterType: array
lang: null
maxChunkSize: 9223372036854775807
maxFileSize: 4194304
nbFilesPerRequest: 1
readCookieFromNavigator: true
readUserAgentFromNavigator: true
retryMaxNumberOf: 1
retryNbSecondsBetween: 30
sendMD5Sum: false
serverProtocol: HTTP/1.1
showLogWindow: true
showStatusbar: true
specificHeaders: null
Headers that will be added to the POST request:
stringUploadError: ^ERROR: (.*)$
stringUploadSuccess: ^SUCCESS$
stringUploadWarning: ^WARNING: (.*)$
*/
$params = array(
// 'urlToSendErrorTo' => '',
'debugLevel' => ($this->debug ? 100 : 0),'scriptable' => 'true',
'mayscript' => 'false','postURL' => $this->target,'maxFileSize' => $maxsize,
'showLogWindow' => $this->showLogWindow,'lookAndFeel' => 'system',
'maxChunkSize' => ($this->use_chunks ? self::MAX_CHUNK_SIZE : 0),
'httpUploadParameterType' => 'array');
if($this->mode == self::MODE_IMAGES)
$params['uploadPolicy'] = 'PictureUploadPolicy';
$paramstring = '';
foreach($params as $key=>$value) {
$paramstring .= "\t" . '' . "\n";
}
$emedstring = '';
foreach($params as $key=>$value) {
$emedstring .= "\t\t\t" . $key . '="' . $value . '"' . "\n";
}
$st = '';
return $st;
}
}