Exemple #1
0
function generateUploadForm(){
	$filenameString=getLanguageString('FILENAME');
	$submitString=getLanguageString('SUBMIT');
	$maxFileSizeString=getLanguageString('MAX_FILESIZE_WARNING').' '.getMaxFileUploadSize().'M';

	$formHtml=<<<EOT
<form action="{$_SERVER['PHP_SELF']}" method="post" enctype="multipart/form-data">
		<p><label for="file">$filenameString:</label>
		<input type="file" name="file" id="file" /><br />
		$maxFileSizeString<br />
		<input type="submit" name="submit" value="$submitString" /></p>
	</form>
EOT;
	return $formHtml;
}
Exemple #2
0
                                    }

                                    totalSize += file.size;
                                    formData.append('file-' + i, file, file.name);
                                }

                                formData.append(
                                    'path',
                                    top.tinymce.activeEditor.windowManager.getParams().path
                                );

                                if (totalSize > Number($('input[name="MAX_FILE_SIZE"]')[0].value)) {
                                    reject(
                                        'De bestanden kunnen niet worden geüpload, ' +
                                        'omdat deze samen groter dan <?php 
echo formatBytes(getMaxFileUploadSize(), 0, true);
?>
 zijn. '
                                    );
                                }

                                formData.append(
                                    settings.csrf.tokenName,
                                    settings.csrf.hash
                                );
                            };

                            if (overwritePromise === undefined) {
                                validate()
                                resolve();
                            } else {