PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 307,104 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,059 people online right now. Registration is fast and FREE... Join Now!




file size limit...

 

file size limit...

rkmalbz

4 Nov, 2009 - 05:53 AM
Post #1

New D.I.C Head
*

Joined: 10 Aug, 2009
Posts: 26


My Contributions
CODE

<form enctype="multipart/form-data" method="post" action="uploads.php">
            <?php
                $poster = $_SESSION["valid_user"];



                if ($_POST["action"] == "Upload") {

                    //if ($_POST[filep]!="") {

                  $folder = "storages/";
                  move_uploaded_file($_FILES["filep"]["tmp_name"] , "$folder".$_FILES["filep"]["name"]);
                  echo "<br/>
                  <p align=center>Filename \"<b>".$_FILES["filep"]["name"]. "</b>\" already exist!!";

                  $resultz = mysql_query("INSERT into storages VALUES($_POST[newsid],'".$_FILES['filep']['name']."','$_POST[entrydesc]')");
                  if($resultz) {
                        echo "<script>self.location='adminpage.php'</script>";
                    }

                //} else {
                //  echo "no files to be uploaded";
                //}
                }

                echo "<tr>
                        <td><input type='hidden' name='newsid' value=". $curid ." /></td>
                      </tr>
                      <tr>
                        <td style='padding: 3px 10px 0px 50px;font:12px tahoma'>Filename</td>
                        <td><input type='file' name='filep' /></td>
                      </tr>
                      <tr valign='top'>
                        <td style='padding: 3px 10px 0px 50px;font:12px tahoma'>File Description</td>
                        <td><textarea style='width:350px;height:150px' name='entrydesc'></textarea></td>
                      </tr>
                      <tr>
                        <td><input type='hidden' name='dates' value=" . $dates ." /></td>
                        <td colspan='2' align='right'><input type='submit' name='action' value='Upload' /></td>
                      </tr>";
            ?>


hello here i am again..i have this code for upload option on my site..buy im having problem uploading a file of more than 2mb of its size..how could i make it to upload up to 10mb only..?? please help me..

User is offlineProfile CardPM
+Quote Post


jaql

RE: File Size Limit...

4 Nov, 2009 - 07:12 AM
Post #2

D.I.C Head
**

Joined: 19 Oct, 2009
Posts: 59



Thanked: 5 times
My Contributions
You've got to change the values of max_upload_size and max_post_size in your php.ini file
User is offlineProfile CardPM
+Quote Post

rkmalbz

RE: File Size Limit...

4 Nov, 2009 - 03:34 PM
Post #3

New D.I.C Head
*

Joined: 10 Aug, 2009
Posts: 26


My Contributions
but the problem is im not hosting my site at home..yes it works when it is hosted at home but im hosting it to a hosting company?? how do i change the max upload size or the max post size via php code?? and base on my code where should i put it??
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 12:33PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month