Results 1 to 12 of 12

Thread: Uploading Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Cool Uploading Problem

    actully im having a problem of uploading heavy files via php. i can upload only files of 2 MB.
    i saw some help about Uploading and made some changes in "php.ini" but still getting the same problem. how can i fix it?
    the code goes here.
    Form.Html
    Code:
    <form enctype="multipart/form-data" action="upload.php" method="post">
     <input type="hidden" name="MAX_FILE_SIZE" value="6582272" />
     Send this file: <input name="userfile" type="file" />
     <input type="submit" value="Send File" />
    </form>
    Upload.php
    Code:
    <?php
    
    $uploaddir = 'uploads/';
    $uploadfile = $uploaddir . $_FILES['userfile']['name'];
    
    print "<pre>";
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
        print "File is valid, and was successfully uploaded. ";
        print "Here's some more debugging info:\n";
        print_r($_FILES);
    } else {
        print "Possible file upload attack!  Here's some debugging info:\n";
        print_r($_FILES);
    }
    print "</pre>";
    
    ?>

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Uploading Problem

    what did you change in the PHP ini? you need to change this line from 2M to something more like 7-10M:
    PHP Code:
    upload_max_filesize 2M 
    make sure you've restarted your web server after making the changes to the ini file.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Uploading Problem

    You might also have to change the web server's own upload limit.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Exclamation Re: Uploading Problem

    Quote Originally Posted by kows
    what did you change in the PHP ini? you need to change this line from 2M to something more like 7-10M:
    PHP Code:
    upload_max_filesize 2M 
    make sure you've restarted your web server after making the changes to the ini file.
    thanks bro for ur reply i was not restarting my Server after making changes. but i also want to know. how much maximum
    PHP Code:
    upload_max_filesize = ??
    i can set?
    actully while uploading songs which are 12 to 13 MB they are not uploading

    Quote Originally Posted by kows

    You might also have to change the web server's own upload limit
    can u be more specific bro?

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Uploading Problem

    Don't misattribute quotes.

    PHP is not the only thing that can impose on file size limits. The web server (Apache or IIS, typically) also can have a maximum size for attachments. You should look at that configuration option, too.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Re: Uploading Problem

    Quote Originally Posted by CornedBee
    Don't misattribute quotes.
    some times it happens boy.
    well thanks for ya help.

    kows bro do u have something which u think i must know ?

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Uploading Problem

    Quote Originally Posted by guarav_raj420
    print "Possible file upload attack! Here's some debugging info:\n";
    Why would you show debugging info to someone that's trying to compromise your server?

    Besides.. there's no such thing as an "attack" that move_uploaded_file will tell you about.

  8. #8

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Lightbulb Re: Uploading Problem

    Quote Originally Posted by penagate
    Why would you show debugging info to someone that's trying to compromise your server?
    What if i want to see the Info myself? if does not matter what i show or not...
    Quote Originally Posted by penagate
    Besides.. there's no such thing as an "attack" that move_uploaded_file will tell you about.
    Imfao the above code is copied from PhpManual

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Uploading Problem

    Yes, it's copied from a user comment. There's a fair amount of rubbish in there.

  10. #10

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Re: Uploading Problem

    Quote Originally Posted by penagate
    Yes, it's copied from a user comment. There's a fair amount of rubbish in there.
    if u already know then why u asked ?

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

  11. #11
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Uploading Problem

    Quote Originally Posted by gaurav_raj420
    if u already know then why u asked ?
    he wanted to know why you kept it there. lol. Mr Know it all
    My usual boring signature: Something

  12. #12

    Thread Starter
    Member
    Join Date
    Nov 2005
    Posts
    48

    Re: Uploading Problem

    Quote Originally Posted by dclamp
    he wanted to know why you kept it there. lol. Mr Know it all
    i think we should all come to the proper topic from where it was start.

    Please keep away yourself from smoking
    ______________________
    If you can't explain then don't write the hint because hint is always before when u have a problem. Okay?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width