Multiple File Upload Script
Moderator: General Moderators
Multiple File Upload Script
I'm wanting to have a upload page on my website that allows users to only upload certain files. I have found an example here http://rauru.com/a-simple-file-upload-script-using-php/ but it doesn't have a progress bar. Any ideas on how to intergrate a progress bar? Or does anyone know of a script that would suit my needs?
Thanks in advance,
Brad
Thanks in advance,
Brad
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multiple File Upload Script
You could use jquery & php.
Take a look at this http://t.wits.sg/2008/06/25/howto-php-a ... gress-bar/
Take a look at this http://t.wits.sg/2008/06/25/howto-php-a ... gress-bar/
Re: Multiple File Upload Script
i am running an xampp based server on windows XP. how can i install that package?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multiple File Upload Script
Not sure, you will have to google the package with windows.
I definitely recommend going to linux for your development environment as your production server will probably be linux - this way you wont have any surprises when you make your website live.
I definitely recommend going to linux for your development environment as your production server will probably be linux - this way you wont have any surprises when you make your website live.
-
maneetpuri
- Forum Commoner
- Posts: 60
- Joined: Tue Oct 07, 2008 6:32 am
Re: Multiple File Upload Script
Hi,
Check this: - http://www.koolphp.net/?mod=products&ac ... xwodDUCVaA
It has the features you need.
Cheers,
Check this: - http://www.koolphp.net/?mod=products&ac ... xwodDUCVaA
It has the features you need.
Cheers,
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multiple File Upload Script
Its not opensource!maneetpuri wrote:Hi,
Check this: - http://www.koolphp.net/?mod=products&ac ... xwodDUCVaA
It has the features you need.
Cheers,
Re: Multiple File Upload Script
ExtJS solution:
http://filetree.extjs.eu/
http://filetree.extjs.eu/
There are 10 types of people in this world, those who understand binary and those who don't
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multiple File Upload Script
extJs is good, but a massive library. From what I remember it is about 0.5MB. And just to use that for an upload system is quite heavy going. I have not looked at it in a while, so I could be wrong as things might have changed.
Re: Multiple File Upload Script
I agree, it is not opensource! Although it does look rather good.
I have had a look at the ExtJS solution, but i can't see how to implement the upload panel into a page. Any help?
I have had a look at the ExtJS solution, but i can't see how to implement the upload panel into a page. Any help?
Re: Multiple File Upload Script
Found this other script on the web (why re-invent the wheel?)
But no matter what I upload it always errors with the “invalid file” message.
This is the form i'm using to call the upload.php file
Code: Select all
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("uploads/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "uploads/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>
This is the form i'm using to call the upload.php file
Code: Select all
<form enctype="multipart/form-data" action="uploader.php" method="POST">
Choose a file to upload: <input name="file" type="file" /><br />
<input type="submit" value="Upload File" />
</form>Re: Multiple File Upload Script
You can build a set of modules of your choice:jaoudestudios wrote:extJs is good, but a massive library. From what I remember it is about 0.5MB. And just to use that for an upload system is quite heavy going. I have not looked at it in a while, so I could be wrong as things might have changed.
http://extjs.com/products/extjs/build/
There are 10 types of people in this world, those who understand binary and those who don't
Re: Multiple File Upload Script
off topic: what happened to pecl4win ? it's been down for several months now. I need my compiled PECL packages!
Re: Multiple File Upload Script
I don't really want to go the ExtJS way...
I have had another look on the net and found that if i want a progress bar i need to include perl scripts in the php.
If someone could tell me or atleast hinto to where i'm going wrong with the above code it would be helpful.
Cheers,
Brad
I have had another look on the net and found that if i want a progress bar i need to include perl scripts in the php.
If someone could tell me or atleast hinto to where i'm going wrong with the above code it would be helpful.
Cheers,
Brad
Re: Multiple File Upload Script
I just tried this and it seems to works OK (I edited out all the double-newlines) but I changed the error line to echo the type and size.Brad7928 wrote:Found this other script on the web (why re-invent the wheel? [...]But no matter what I upload it always errors with the “invalid file” message.
Code: Select all
echo "Invalid file type/size: " . $_FILES["file"]["type"] . ":" . $_FILES["file"]["size"];