473,473 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

upload multiple files...

hola..
i need a help...this is my coding for uploading multiple files...the
problem is..i want the files that i have been upload will show in the
same page but using only one text box..can anyone help me?plz...i
really need a help..

<HTML>
<HEAD>
<title>FILE UPLOAD</title>
<body bgcolor="magenta">

<form method="POST" ENCTYPE="multipart/form-data"
action="uploadfile.php">

<p>
Files:<br>

<input type="file" name="uploadFile" size="40">

<br>
<input type="file" name="uploadFile2" size="40">
</p>
<p>
<input type="submit" value="Submit">
<br>
<br>
<?php

// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);

$_FILES['uploadFile']['tmp_name'];
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadFile']['name']);
if(move_uploaded_file($_FILES['uploadFile']['tmp_name'], $target_path))
{
echo "The file ". basename( $_FILES['uploadFile']['name']).
" has been uploaded = ";
} else{
echo " ";
}

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);
$target_name = basename( $_FILES['uploadFile']['name']);
$dir=" ";

echo "<a href='{$dir}/{$target_path}'>{$target_name}</a><br />";


// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);
$_FILES['uploadFile2']['tmp_name'];
$target_path = "uploads/";

$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);

if(move_uploaded_file($_FILES['uploadFile2']['tmp_name'],
$target_path)) {
echo "The file ". basename( $_FILES['uploadFile2']['name']).
" has been uploaded = ";
} else{
echo " ";
}

$target_path = "uploads/";
$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);
$target_name = basename( $_FILES['uploadFile2']['name']);
$dir=" ";

echo "<a href='{$dir}/{$target_path}'>{$target_name}</a><br />";


?>
</form>
</body>
</HEAD>
</HTML>

Sep 5 '06 #1
0 1693

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

Similar topics

6
by: x. zhang | last post by:
Hi Guys, We know that we can use <input type=file ...> to upload one file per time to the server. My question is if there are some way to upload multiple files per time to the server. (Of...
5
by: Jason | last post by:
I have a potential need to upload multiple PDF legal documents. Is it possible to attach more than one file per upload?
7
by: crowl | last post by:
Hi there, I am looking for a component allowing me uploading multiple files by my asp page. I have found several components achieving this by require a <input type="file" name="FileX"> field for...
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"...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
7
by: der_grobi | last post by:
That is the Problem: I have an ASP.NET Webapplicatipon where I can upload single files to the Server. That works fine. But now, I want to Upload multiple files. I know the path of the files, i...
6
by: Milan Krejci | last post by:
while(list($key,$value) = each($_FILES)) { if(!empty($value)){ $filename = $value; $add = "upimg/$filename"; echo $_FILES; $error=copy($_FILES, $add); if (!$error)...
43
by: bonneylake | last post by:
Hey Everyone, Well this is my first time asking a question on here so please forgive me if i post my question in the wrong section. What i am trying to do is upload multiple files like gmail...
4
by: MoroccoIT | last post by:
Greetings - I saw somewhat similar code (pls see link below) that does mupltiple files upload. It works fine, but I wanted to populate the database with the same files that are uploaded to...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.