Nieuw lid |
|
$oFile = new FileUpload($_FILES['file_upload']);
$oFile->addFileType('skp', 'application/octet-stream');
$oFile->addFileType('dwg', 'application/acad');
$oFile->addFileType('zip', 'application/binary');
$oFile->addFileType('pdf', 'application/pdf');
$oFile->addFileType('doc', 'application/msword');
$oFile->addFileType('docx', 'application/msword');
$oFile->addFileType('ppt', 'application/mspowerpoint ');
$oFile->setMaxSize(8000000);
$oFile->move('bestanden');
if ($oFile->getErrors() === false) {
echo '<pre>', var_dump($_FILES), '</pre>';
} else {
/* We have encountered an error while uploading our file. To get the
* exact error we can use the array returned by the getErrors()
* function. */
echo '<pre>', var_dump($oFile->getErrors()), '</pre>';
}
$oFile = new FileUpload($_FILES['file_upload']); $oFile->addFileType('skp', 'application/octet-stream'); $oFile->addFileType('dwg', 'application/acad'); $oFile->addFileType('zip', 'application/binary'); $oFile->addFileType('pdf', 'application/pdf'); $oFile->addFileType('doc', 'application/msword'); $oFile->addFileType('docx', 'application/msword'); $oFile->addFileType('ppt', 'application/mspowerpoint '); $oFile->setMaxSize(8000000); $oFile->move('bestanden'); if ($oFile->getErrors() === false) { } else { /* We have encountered an error while uploading our file. To get the * exact error we can use the array returned by the getErrors() * function. */ }
Ik heb nu bovenstaande code om de class aan te roepen. Maar ik begrijp dan nog niet helemaal hoe ik dan apart de variabele eruit krijg. Zou je misschien een voorbeeldje kunnen geven a.d.h.v. mijn code? |