I can only upload 5 mb with php

Problems with the Windows version of XAMPP, questions, comments, and anything related.

I can only upload 5 mb with php

Postby Gabriele97 » 26. May 2011 11:00

Hi, I have this code

Code: Select all
<html>
<head>
<title>Upload di file in PHP</title>
</head>
<body>
<h1>Upload</h1>
<b>Dimesione massima: 5mb<br>Per upload di file più grandi, utilizzare <a href="ftpaccess.php">l'accesso via FTP</a></b>
<form method="post" action="up.php" enctype="multipart/form-data">
<input type="file" name="fdc" size="50">
<input type="submit" name="upload" value="Upload">
<input value="<?php echo "".$_GET['ps']; ?>" name="a" type="hidden">
</form>
<?
    if ($_POST["upload"] != "")
    {
        //$percorso = "../pubblic/video/";
      //$percorso = "http://gabriele97.no-ip.org".$_GET['ps']."/";
      $percorso = "..".$_POST['a']."/";
        $fdc_temp = $_FILES["fdc"]["tmp_name"];
        $fdc_name = $_FILES["fdc"]["name"];
        if (move_uploaded_file($fdc_temp, $percorso . $fdc_name))
        {
         $ciao = $_POST['a'];
            //echo "Upoload eseguito con successo.<br> <a href='$percorso'>Torna Indietro</a> o <a href='up.php?ps=$ciao'>Riesegui un'altro upload</a>";
         header("location: $percorso");
        }
        else
        {
            echo "Si è verificato un errore in fase di upoload<br>";
         echo "Riprova";
        }
    }
?>
</body>
</html>

can try here: File Upload in PHP

then, if I try to run the file upload that measure less than 5mb okay, but if I try to upload files larger than 5mb, I get redirected to the page without up.php? ps = / public

I can not understand why ... HELP!
Gabriele97
 
Posts: 2
Joined: 26. May 2011 10:50

Re: I can only upload 5 mb with php

Postby Sharley » 26. May 2011 12:01

I am assuming XAMPP version 1.7.4 here.

Your form is using post and in the php.ini file there is a small max post size limit.

So you can try this - open \xampp\php\php.ini in your text editor and find this section
Code: Select all
; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 8M
Change the 8M to 128M then save the file in ANSI text mode (not utf8) if using Notepad and then restart Apache and try again to upload a larger file.

That hopefully will fix your issue.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: I can only upload 5 mb with php

Postby Gabriele97 » 26. May 2011 12:10

Go! I did! thanks. 8M but does not refer to 8Mb?
Gabriele97
 
Posts: 2
Joined: 26. May 2011 10:50


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 158 guests