- // Directory to store uploaded files
+ // Description for this website
+ 'description' => '',
+
+ // Base path (auto-detection)
+ 'base_path' => dirname(__FILE__) . DIRECTORY_SEPARATOR,
+
+ // Directory to store uploaded files (relative to base_path)
// Maximum upload size, set by system
$data['max_upload_size'] = ini_get('upload_max_filesize');
// Maximum upload size, set by system
$data['max_upload_size'] = ini_get('upload_max_filesize');
// Do now allow to overwriting files
if (isReadableFile($file_data['upload_target_file'])) {
echo 'File name already exists' . "\n";
// Do now allow to overwriting files
if (isReadableFile($file_data['upload_target_file'])) {
echo 'File name already exists' . "\n";
}
// Moving uploaded file OK
if (move_uploaded_file($file_data['tmp_name'], $file_data['upload_target_file'])) {
}
// Moving uploaded file OK
if (move_uploaded_file($file_data['tmp_name'], $file_data['upload_target_file'])) {
$_SESSION['upload_user_files'][] = $file_data['target_file_name'];
echo $settings['url'] . $file_data['target_file_name'] . "\n";
$_SESSION['upload_user_files'][] = $file_data['target_file_name'];
echo $settings['url'] . $file_data['target_file_name'] . "\n";
header('Content-type: text/plain');
if (is_array($_FILES['file'])) {
$file_array = diverseArray($_FILES['file']);
header('Content-type: text/plain');
if (is_array($_FILES['file'])) {
$file_array = diverseArray($_FILES['file']);
- foreach ($file_array as $file_data)
- uploadFile($file_data);
- } else
- uploadFile($_FILES['file']);
+ foreach ($file_array as $file_data) {
+ $targetFile = uploadFile($file_data);
+ }
+ } else {
+ $targetFile = uploadFile($_FILES['file']);
+ }
- while ($filename = readdir($dh)) {
- $fqfn = $dir . DIRECTORY_SEPARATOR . $filename;
- if (isReadableFile($fqfn) && !in_array($filename, $data['ignores']))
- $file_array[filemtime($fqfn)] = $filename;
- }
+
+ while ($filename = readdir($dh)) {
+ $fqfn = $dir . DIRECTORY_SEPARATOR . $filename;
+ if (isReadableFile($fqfn) && !in_array($filename, $data['ignores']))
+ $file_array[filemtime($fqfn)] = $filename;
+ }
<form action="<?= $data['scriptname'] ?>" method="post" enctype="multipart/form-data" class="dropzone" id="simpleupload-form">
Maximum upload size: <?php echo $data['max_upload_size']; ?><br />
<input type="file" name="file[]" id="simpleupload-input" />
<form action="<?= $data['scriptname'] ?>" method="post" enctype="multipart/form-data" class="dropzone" id="simpleupload-form">
Maximum upload size: <?php echo $data['max_upload_size']; ?><br />
<input type="file" name="file[]" id="simpleupload-input" />