file upload problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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:

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?

Re: file upload problem

Quoted text here. Click to load it

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 (?).

Re: file upload problem

What does the rest of the form look like? print_r is showing file,
file1, file2. Is there a form field you're not showing in your code

Read this section of the Php manual and be sure to look at Related
configuration notes. Other php.ini settings besides upload_max_filesize
can effect post

Re: file upload problem

Jeremy Deuel wrote:
Quoted text here. Click to load it

How this can be done? Two forms with one submit? and how do I get the
data? on only one POST?

Re: file upload problem

Quoted text here. Click to load it

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  
if you have the extended chm manual search in the notes for "file upload" or  
can search online, in  
the notes.   you will see a number of code examples of how to handle  
multi-file uploads.

Site Timeline