Re: HTTP/Upload.php can't handle multiple files!!
| From: | Louie Miranda | Date: | Wed, 08 Sep 2004 06:48:29 +0000 |
| Subject: | Re: HTTP/Upload.php can't handle multiple files!! | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14448@lists.php.net to get a copy of this message | ||
I got this array..
rray
(
[userfile] => Array
(
[name] => Array
(
[0] => xml_Appendix_B.pdf
[1] => xml_Appendix_C.pdf
[2] => xml_Chapter_7.pdf
)
i mean i got the three files.. but nothing is being uploaded?
i did this..
Image 1: <input type="file" name="userfile[]"><br>
Image 2: <input type="file" name="userfile[]"><br>
Image 3: <input type="file" name="userfile[]"><br>
and replaced..
$files = $upload->getFiles('userfile[]'); // returns an array of file
objects or error
and add a foreach. but its still not uploading..
foreach ($files as $file) {
if ($file->isValid()) {
$file->setName('uniq');
$dest_dir = './uploads/';
$dest_name = $file->moveTo($dest_dir);
if (PEAR::isError($dest_name)) {
die ($dest_name->getMessage());
}
$real = $file->getProp('real');
echo "Uploaded $real as $dest_name in $dest_dir\n";
} elseif ($file->isMissing()) {
echo "No file selected\n";
} elseif ($file->isError()) {
echo $file->errorMsg() . "\n";
}
} // end foreach
On Wed, 8 Sep 2004 14:42:23 +0800, Louie Miranda <lmiranda@gmail.com> wrote:
> i found this..
>
> http://vulcanonet.com/soft/index.php?pack=uploader
>
> im working on it.
>
>
>
>
> On Wed, 8 Sep 2004 14:34:02 +0800, Louie Miranda <lmiranda@gmail.com> wrote:
> > i have tried HTTP/Upload but it can't handle multiple files!
> >
> > my form:
> > <form action="<?php echo $_SERVER['PHP_SELF'];?>?submit=1"
> > method="post" enctype="multipart/form-data">
> > Send these files:<br>
> > <input type="hidden" name="MAX_FILE_SIZE"
> > value="100000">
> >
> > <input name="userfile" type="file"> <-<br>
> > <input name="otherfile" type="file"><br>
> > <input name="otherfile[1]" type="file"><br>
> > <input type="submit" value="Send files">
> > </form>
> >
> > i tried to edit this..
> >
> > $upload = new http_upload('es');
> > $file = $upload->getFiles('userfile');
> > $file = $upload->getFiles('otherfile');
> >
> > but, it wont work.
> >
> >
> > --
> > Louie Miranda
> > http://www.axishift.com
> >
>
> --
> Louie Miranda
> http://www.axishift.com
>
--
Louie Miranda
http://www.axishift.com