dezkit Posted September 27, 2008 Share Posted September 27, 2008 Hi i am trying to find a download link to a upload progress bar for php But i am very confused! here is my php code, i don't know what to do with it to make a upload bar! help me! <?php function findexts($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } global $string; $pattern = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; if(empty($length)){ $length = "10"; } for($i=0; $i<$length; $i++){ $string .= $pattern{rand(0,61)}; } $ext = findexts($_FILES['ufile']['name']); $path= "uploads/$string.$ext"; $ufilename = "$string.$ext" if($ufile != none){ if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path)){ echo "File Upload has been successful.<BR/><BR/>"; echo "<table border=0>"; echo "<tr><td>"; echo "File Name: "; echo "<td>"; echo "$ufilename"; echo "<tr><td>"; echo "File Size: "; echo "<td>"; echo round(($HTTP_POST_FILES['ufile']['size'] / 1024),2); echo "MB (" . round($HTTP_POST_FILES['ufile']['size'],2) . " KB)"; echo "<tr><td>"; echo "File Type: "; echo "<td>"; echo $HTTP_POST_FILES['ufile']['type']; echo "</table>"; echo "<BR/>Click <a href=\"$path\">here</a> to view the uploaded file."; } else { echo "Error"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/ Share on other sites More sharing options...
dezkit Posted September 27, 2008 Author Share Posted September 27, 2008 Also guys, please don't link me to some tutorials, i have been searching for the php progress bars since i first started coding php, like a year ago Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/#findComment-652064 Share on other sites More sharing options...
.josh Posted September 27, 2008 Share Posted September 27, 2008 You can't make a progress bar with just php, as it is parsed on the server and the results are then sent to the client. Look into ajax. Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/#findComment-652071 Share on other sites More sharing options...
Barand Posted September 28, 2008 Share Posted September 28, 2008 I've been searching for five seconds http://www.google.co.uk/search?q=php+upload+progress+bars Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/#findComment-652122 Share on other sites More sharing options...
dezkit Posted September 28, 2008 Author Share Posted September 28, 2008 is it possible so there would be NO progress bars? but just percentage and kb/s? @barand: all those links are highlighted in purple. Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/#findComment-652125 Share on other sites More sharing options...
Barand Posted September 28, 2008 Share Posted September 28, 2008 Percentage or kb/s (+ original size) are all you need to generate a bar. Quote Link to comment https://forums.phpfreaks.com/topic/126099-need-basic-help/#findComment-652268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.