Hallo zusammen.
Ich habe folgendes Problem: Wenn ich über QuickForm nun eine Datei uploaden will, streikt er einfach. Das Formular und die rules werden auch beachtet.
Danke schonmal.
Der Code(Aus einem Tut zu ausprobieren):
require_once "HTML/QuickForm.php";
$uploadForm = new HTML_QuickForm('upload_form', 'post');
$path = "e:/uploads";
$uploadForm->addElement('hidden', 'path', $path);
$file =& $uploadForm->addElement('file', 'filename', 'File:');
$uploadForm->addRule('filename', 'You must select a file', 'uploadedfile');
$uploadForm->addElement('submit', 'btnUpload', 'Upload');
if ($uploadForm->validate()) {
$uploadForm->process('process', true);
}
else {
$uploadForm->display();
}
function process($values) {
global $file;
if ($file->isUploadedFile()) {
$file->moveUploadedFile($values['path']);
}
else {
print "No file uploaded";
}
}