473,386 Members | 1,757 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,386 software developers and data experts.

uploading multiple files

44
hi everyone
i have a problem with uploading two files at the at the same time.
cause the code below tells me that invalid supply argument forach.
[php]
destfile = /pathe/to/directory;
foreach ($_FILES["uploaded"]["error"] as $key => $error)
{
if ($error == UPLOAD_ERR_OK)
{
$tmp_name = $_FILES["uploaded"]["tmp_name"][$key];
$name = $_FILES["uploaded"]["name"][$key];
if(move_uploaded_file($tmp_name, $destfile ))
{
echo"copied successfully to:".$destfile."<br>";
}
else
{
echo"failed to copy the files to:".$destfile."<br>";
}

}
}[/php]

After so many posts (31) you know that you must include all code within the appripriate code tags. - moderator
Feb 29 '08 #1
4 1443
Markus
6,050 Expert 4TB
Can't see anything wrong with it..
Can you post the form?
USE CODE TAGS.
Feb 29 '08 #2
hsriat
1,654 Expert 1GB
Line 8:[php]if(move_uploaded_file($tmp_name, $destfile."/".$name))[/php]
Feb 29 '08 #3
Markus
6,050 Expert 4TB
Line 8:[php]if(move_uploaded_file($tmp_name, $destfile."/".$name))[/php]
Nice spot, but it was a problem with the foreach arguments?
Feb 29 '08 #4
hsriat
1,654 Expert 1GB
Line 1:[php]$destfile = "/pathe/to/directory";[/php]

@Mark, may be not ... :-/
Feb 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No...
2
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
2
by: Jason | last post by:
Hi I have this web application for an intranet. I would like to be able to upload 1 or more files from the client machine. for example: the client is working with 10 files and after he is done...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
4
by: Corey Erkes | last post by:
I am using ASP.Net with C# as the code behind and am trying to upload multiple files with the HTMLInputFile Control. I am able to browse, select a file, and finally upload, but only one file at a...
2
by: tshad | last post by:
I have a page that I am using for multiple uses that includes reposting of the page as well as going to another page where the "form" tag would be something like: <form id="something"...
1
by: Sönke Greve | last post by:
Hi there, i want to enable uploading lots of images and later display it as an online gallery. Therefore i need a way of using the FileUpload Component with selecting multiple files or a whole...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
2
by: Zoliq | last post by:
Hi, I have a serious problem. I'm currently developing an application in which the user should upload many files (600-700 xml files). I've searched the web for a while and so far I realized that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.