1
borisj
Re:uploader.php and Notice: Undefined index:
  • 2005/11/7 16:20

  • borisj

  • Just popping in

  • Posts: 2

  • Since: 2004/3/30


Hi guys, and sorry for my english,

I met the same issue, and I found a solution:

In fact, if I'm not wrong, what you need to understand is that only the variable's content you use in your XoopsFormFile function (fichier_profil for me), is used.
So don't make the FetchMedia test on the variable's name you used, but on the one use by the XOOPS class.

If my explanations do not seem clear to you, please take a look on the code below, as it worked for me.


switch($op) {

case 'do_upload':

$allowed_mimetypes = array('application/lua','image/png','image/gif','image/jpg');
$maxfilesize = 5000000;
$maxfilewidth = 5000000;
$maxfileheight = 5000000;
$uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH.'/modules/wowclan/profils',$allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);

if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
if (!$uploader->upload()) {
echo $uploader->getErrors();
} else {
echo '<h4>Fichier uploadé avec succés!</h4>';
echo 'Enregistré sous : ' . $uploader->getSavedFileName() . '<br />';
echo 'Chemin complet: ' . $uploader->getSavedDestination();
}
} else {
echo $uploader->getErrors();
}

break;

case 'default':
default:
$description = new XoopsFormFile("Selectionner votre profil", "fichier_profil", 5000000);
$op_hidden = new XoopsFormHidden("op", "do_upload");
$button = new XoopsFormButton("", "submit", "Uploader", "submit");

$form = new XoopsThemeForm("UPLOADER", "formulaire", "upload.php", "POST", true);

$form->setExtra( "enctype='multipart/form-data'" ) ;
$form->addElement($description);
$form->addElement($op_hidden);
$form->addElement($button);
$form->display();


break;

}



2
borisj
Re: Meta-Generator ???
  • 2004/5/19 9:27

  • borisj

  • Just popping in

  • Posts: 2

  • Since: 2004/3/30


Hi,

Sorry for my english but i'm french.

I see your post.

At this days i'm making an adaptation of meta-generator for XOOPS 2.06.

I just need somme information about how is use the original xoops_header() function.

If someone have some informations, i'm interested

Bie !!!




TopTop



Login

Who's Online

229 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits