I’ve got a PHP script that I learned how to make largely from reading online “How-To” manuals . . . well, it’s not working, and everything LOOKS okay, I’m hoping someone who actually KNOWS what they’re doing can help.
[code=php]<?php
$target = “./”;
$target = $target . basename( $_FILES[‘uploaded’][‘name’]) ;
$ok=1;
//This is our size condition
if ($uploaded_size > 262144000)
{
echo “Your file MUST be smaller than 250MB’s.<br />”;
$ok=0;
}
//This is our limit file type condition
if ($uploaded_type != “application/pdf” || “audio/mpeg” || “audio/x-mpegurl” || “audio/x-wav” || “image/bmp” || “image/gif” || “image/jpeg” || “image/tiff” || “video/mpeg” || “video/quicktime” || “video/x-la-asf” || “video/x-la-asf” || “video/x-ms-asf” || “video/x-msvideo”)
{
echo “YOUR FILE TYPE IS NOT ALLOWED<br />”;
$ok=0;
}
else
{
echo “YOUR FILE TYPE IS APPROVED<br />YOU WILL BE REDIRECTED IN 5 SECONDS”;
$ok=1;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo “Sorry your file was not uploaded”;
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES[‘uploaded’][‘tmp_name’], $target))
{
echo “The file “. basename( $_FILES[‘uploadedfile’][‘name’]). ” has been uploaded”;
}
else
{
echo “Sorry, there was a problem uploading your file.”;
}
}
?>
I’m wanting to add a progress bar, so they don’t think their browser has stalled out on really big files, and I’m trying to send a user back to the main page once the upload is finished.
All these things are happening on [ [url]http://casey.wickedsmaat.com