| Re: two uploads one form |
| by urbanspacema on 2009/8/15 20:56:15 tnx ghia |
| Re: two uploads one form |
| by ghia on 2009/8/15 16:06:59 XcGal has a form for uploading four files (not using XOOPS core). Search for _FILES |
| Re: two uploads one form |
| by Mazar on 2009/8/15 15:57:54 I remember once i asked a similar question to use uploader class for multiple uploads i was told the class allows only single upload at a time. |
| Re: two uploads one form |
| by ghia on 2009/8/15 15:03:26 It should be possible to upload several files at once with one form. A practical limit (depending on file size) is 4. I must say your code differs from the example code given in the header of /class/uploader.php |
| two uploads one form |
| by urbanspacema on 2009/7/31 17:59:12 Hello all I'm coming to develop a module but i have an issue with file upload. My form has 2 field for upload file, one for image and one for a file (mp3/wma in my case) the code is this (the module was generated from TDMCreate) le="color: #000000"><?php //Form podcast_image include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploaddir_podcast_image = XOOPS_ROOT_PATH."/uploads/podcast/podcast/podcast_image/"; $uploader_podcast_image = new XoopsMediaUploader($uploaddir_podcast_image, $xoopsModuleConfig["podcast_image_mimetypes"], $xoopsModuleConfig["podcast_image_size"], null, null); if ($uploader_podcast_image->fetchMedia("podcast_image")) { $uploader_podcast_image->setPrefix("podcast_image_") ; $uploader_podcast_image->fetchMedia("podcast_image"); if (!$uploader_podcast_image->upload()) { $errors = $uploader_podcast_image->getErrors(); redirect_header("javascript:history.go(-1)",3, $errors); } else { $obj->setVar("podcast_image", $uploader_podcast_image->getSavedFileName()); } } else { $obj->setVar("podcast_image", $_REQUEST["podcast_image"]); } //Form podcast_file include_once XOOPS_ROOT_PATH."/class/uploader.php"; $uploaddir_podcast_file = XOOPS_ROOT_PATH."/uploads/podcast/podcast/podcast_file/"; $uploader_podcast_file = new XoopsMediaUploader($uploaddir_podcast_file, $xoopsModuleConfig["podcast_file_mimetypes"], $xoopsModuleConfig["podcast_file_size"], null, null); if ($uploader_podcast_file->fetchMedia("podcast_file")) { $uploader_podcast_file->setPrefix("podcast_file_") ; $uploader_podcast_file->fetchMedia("podcast_file"); if (!$uploader_podcast_file->upload()) { $errors = $uploader_podcast_file->getErrors(); redirect_header("javascript:history.go(-1)",3, $errors); } else { //$obj->setVar("podcast_file", $uploader_podcast_file->getSavedFileName()); $obj->setVar("podcast_file", $uploader_podcast_file->getSavedFileName()); } } the image was uploaded coreectly and his name insert in the database. the file is not loaded. and get any error message. can be the upload XOOPS class does not allow two upload from the same form? |