Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 5th, 2007, 11:10 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kaos_frack
Default how do i determine size of file being uploaded?

is it possible to identify the size of a file that is being uploaded?
if yes, what if there are several files being uploaded?
tnx

  #2 (permalink)  
Old January 6th, 2007, 01:29 AM
hit hit is offline
Registered User
 
Join Date: Jan 2007
Location: Indore, MP, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can the following lines help you??

<?php
    if(isset($_POST['submit'])){
        echo "File Size: ". filesize($_FILES['testfile']['tmp_name']). " bytes";
    }
?>
<html>
    <body>
        <form method="post" action="" enctype="multipart/form-data">
            <input type="file" name="testfile" />
            <input type="submit" name="submit" value="submit" />
        </form>
    </body>
</html>
  #3 (permalink)  
Old January 10th, 2007, 06:27 AM
Authorized User
 
Join Date: Dec 2006
Location: Burla, Orissa, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to paagle
Default

$sizevariable = filesize('filename');
is the code do anythin u want to after this................

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)
  #4 (permalink)  
Old January 10th, 2007, 03:48 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kaos_frack
Default

Quote:
quote:Originally posted by hit
 Can the following lines help you??
it sure does, thanks a lot!


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Path of uploaded file in JSP murulikblr JSP Basics 0 April 17th, 2007 02:05 AM
Verifying uploaded File Size in Client-side Ushhh ASP.NET 1.0 and 1.1 Professional 5 August 30th, 2006 07:13 AM
deleting a file after it is been uploaded yts007 Dreamweaver (all versions) 1 August 16th, 2006 01:05 AM
Read an uploaded Excel File rekha_jsr Classic ASP Basics 0 June 12th, 2005 10:17 PM
Uploaded a cvs file via phpMyAdmin from a PocketPC bourdett PHP How-To 0 January 8th, 2005 12:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.