473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

file upload problem

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?
Feb 17 '06 #1
4 6796
In article <dt**********@volcano1.grnet.gr>,
G0ng <hk******@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 (?).
Feb 17 '06 #2
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
above?

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
uploadshttp://de.php.net/manual/en/features.file-upload.php#features.file-upload.post-method
v

Feb 17 '06 #3
Jeremy Deuel wrote:
In article <dt**********@volcano1.grnet.gr>,
G0ng <hk******@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?
Feb 20 '06 #4

"G0ng" <hk******@softnet.tuc.gr> wrote in message
news:dt**********@volcano1.grnet.gr...
Jeremy Deuel wrote:
In article <dt**********@volcano1.grnet.gr>,
G0ng <hk******@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
Apr 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
3
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the...
6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
4
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use...
5
by: William LaMartin | last post by:
I have a VB ASP.Net application where the user can upload a file using the FileUpload server control. I also want a thumbnail to be created for this file. Unfortunately I can see no means to...
4
by: riteshjain82 | last post by:
Hi, Please go through this: I am having a file (default.asp) on which i am taking many details from a user before mailing it to someone. I have also provided the user with a facility of...
6
by: Vic Spainhower | last post by:
Hello, I am trying to do a FTP file upload which works fine on my localhost but on my ISP server it fails. I can't seem to find where I can go to find the specific cause of the failure. In both...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
1
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.