2
Am I asking a dumb question? This is the first question that hasn't been answered. How about if I add some source:
FORM:
$filegad = new XoopsFormFile('Attachment', 'upload_file', 2000000);
$file_tray = new XoopsFormElementTray("", " ");
$file_tray->addElement($filegad);
$entryform->addElement($file_tray);
$entryform->addElement($submit);
$entryform->addElement($button);
$entryform->display();
I select /home/phillipd/somefile.jpeg from the file selector.
REcieving script
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
$maxfilesize = 50000;
$maxfilewidth = 120;
$maxfileheight = 120;
$uploader = new XoopsMediaUploader('/home/xoops/uploads', $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
if ($uploader->fetchMedia($_POST['uploade_file'])) {
if (!$uploader->upload()) {
echo $uploader->getErrors();
} else {
echo '
File uploaded successfully!
';
echo 'Saved as: ' . $uploader->getSavedFileName() . '
';
echo 'Full path: ' . $uploader->getSavedDestination();
}
} else {
echo $uploader->getErrors();
}
If I $_POST['upload_file']; I get "somefile.jpeg". Where did the path component go?
Thanks
Doug P