You are here: Re: file upload problem « PHP Programming Language « IT news, forums, messages
Re: file upload problem

Posted by Jim Michaels on 11/19/05 11:45

"G0ng" <hkosmidi@softnet.tuc.gr> wrote in message
news:dtbtou$rhg$1@volcano1.grnet.gr...
> Jeremy Deuel wrote:
>> In article <dt438i$82a$1@volcano1.grnet.gr>,
>> G0ng <hkosmidi@softnet.tuc.gr> wrote:
>>
>>
>>>Hello. I have a form with two input file fields for uploading file:
>>>
>>><form name="mynews" action="news.php?action=update&add=<?php print
>>>$id;?>" method="post" enctype="multipart/form-data">
>>>
>>><input type="file" name="file1" size="20">
>>><input type="file" name="file2" size="20">
>>>
>>>When I post I do:
>>>print_r($_FILES);
>>>
>>>this is the output:
>>>Array ( [file] => Array ( [name] => [type] => [tmp_name] => [error] => 4
>>>[size] => 0 ) [file1] => Array ( [name] => PlhroforikhMetaptuxiako.pdf
>>>[type] => application/pdf [tmp_name] => /tmp/phpIIYUYT [error] => 0
>>>[size] => 48755 ) [file2] => Array ( [name] => [type] => [tmp_name] =>
>>>[error] => 4 [size] => 0 ) )
>>>
>>>The seconf file is never uploaded no matter what I tried.
>>>Upload_file_size is 8MB which is ok for both files.
>>>
>>>what else can I check?
>>
>>
>>
>> Make two forms, with one upload per form and a javascript, that sends
>> both forms at once.
>>
>> IMHO per form only one file can be uploaded (?).
>
> How this can be done? Two forms with one submit? and how do I get the
> data? on only one POST?

1. you can't submit more than 1 form at once, even with javascript.
2. you can have as many file fields as you want, if you name them
name="file[]"
if you have the extended chm manual search in the notes for "file upload" or
can search online, http://us2.php.net/manual/en/features.file-upload.php in
the notes. you will see a number of code examples of how to handle
multi-file uploads.
Look

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация