file transfer in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • somaskarthic
    New Member
    • Aug 2006
    • 60

    file transfer in php

    Hi

    How to upload larger files (nearly 50 MB size) in php .
    I tried ,
    if(move_uploade d_file($_FILES["file"]["tmp_name"],"/home/lcscon/public_html/admin/".$_FILES["file"]["name"]))
    {
    echo "File has been uploaded .";
    }
    else
    {
    echo "Not Uploaded";
    }
    ?>

    I even tried ,

    $upload = ftp_put($conn_i d,$destination_ file,$source_fi le,FTP_BINARY);

    But it fails. It upload upto files of max size 7 MB.

    MAX_FILE_UPLOAD size in php.ini file edited to 80 MB (from 2M).
    POST MAX SIZE also configured to large enough.

    How can i upload larger files ? Or is there any sample available for uploading larger files (50 MB) .

    Thanks in advance
    somaskarthic
  • steven
    New Member
    • Sep 2006
    • 143

    #2
    Provided your values are correct in the config, I can't see why it shouldn't work.

    Be certain that in your php.ini you haven't used 'MB'. It should be '50M', without the quotes of course.

    You will also need to make sure the hidden field in your form is correct and should be:

    [html]<input type="hidden" name="MAX_FILE_ SIZE" value="xxx" />[/html]

    In your case, 'xxx' should be:

    52428800 for 50MBytes and 83886080 for 80MBytes.

    I know you said that you had these set already, but please make sure the values are correct and maybe post your code. I also see that you say you have post max size correctly set too....

    According to php.net,

    If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.


    Comment

    • steven
      New Member
      • Sep 2006
      • 143

      #3
      Damn the edit block...

      Also note:

      max_input_time sets the maximum time, in seconds, the script is allowed to receive input; this includes file uploads. For large or multiple files, or users on slower connections, the default of 60 seconds may be exceeded.
      From php.net

      Read those links. I'm sure there are many other factors you need to consider to enable these large uploads. Good luck.

      Comment

      • somaskarthic
        New Member
        • Aug 2006
        • 60

        #4
        Hi

        I need to know all the possibe settings that has to be made for uploading larger files (app. 50 MB) in php. Let me know some links or sample php.ini configuration file for large uploads. I tried most of the possibilites. I don't know where the problem lies. Please give me the clear steps to be followed.


        Thanks in advance.
        somaskarthic





        Originally posted by steven
        Damn the edit block...

        Also note:



        From php.net

        Read those links. I'm sure there are many other factors you need to consider to enable these large uploads. Good luck.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Originally posted by somaskarthic
          I need to know all the possibe settings that has to be made for uploading larger files (app. 50 MB) in php. Please give me the clear steps to be followed.
          Anything else to order?

          Ronald :cool:

          Comment

          Working...