upload large files using php, apache

后端 未结 5 724
再見小時候
再見小時候 2020-11-27 07:25

I want to upload files of around 150 MB using PHP and Apache server. With my code i can upload upto 5MB



        
相关标签:
5条回答
  • 2020-11-27 07:43

    here is some good info about uploading files in PHP

    Upload files PHP info

    Or you could also read up on it here using an Java applet that uploads the file in chunks. Search for Jupload

    php/Apache Config You will need to change the value of both upload_max_filesize and post_max_size to the largest filesize you would like to allow. Then restart apache and everything should work.

    0 讨论(0)
  • 2020-11-27 07:55

    If you are using a shared server and want to upload large files, create a php.ini file and write the following code into it and put it in the folder where you are uploading the files, i.e. the destination of your uploaded files.

     upload_max_filesize = 150M
     post_max_size = 150M
     memory_limit = 512M
     max_execution_time = 1200 
    
    0 讨论(0)
  • 2020-11-27 07:58

    Chunking file uploads using ajax

    I tested many solutions and my choice is Blueimp. Here is my rating list:

    1. Blueimp - 111KB, https://github.com/blueimp/jQuery-File-Upload
    2. Plupload - 359KB, developed for TinyMCE, supports HTML5 to Flash, Gears, Silverlight and iFrame, http://www.plupload.com/
    3. Fineuploader - 944KB, http://fineuploader.com/

    Other solution tested by me

    1. Uploadify - http://www.uploadify.com/
    2. Resumable - https://github.com/23/resumable.js
    3. Dropzonejs - http://www.dropzonejs.com/
    4. MooUpload
    5. Fancyupload
    6. Hayageek http://hayageek.com/docs/jquery-upload-file.php
    0 讨论(0)
  • 2020-11-27 08:02

    I'd also check the max input time and script execution time. They're both currently set to 300 seconds (5 minutes). That would mean the user has to upload 150 mb (1200 mega-bits) in 300 seconds. That means the end user would need a solid and consistent 4mbps connection (1200 / 300 = 4) to upload that file in the allotted time.

    I would recommend something similar to these settings:

    file_uploads = On
    upload_tmp_dir = "/your/tmp/dir"
    upload_max_filesize = 150M ; You may want to bump this to 151M if you have problems with 150 mb files
    max_execution_time = 1200 ; 20 minutes, which is a 150 mb file at 1mbps
    max_input_time = 1200
    
    0 讨论(0)
  • 2020-11-27 08:02

    You might try using AJAX and PHP streams, this way memory usage will be under 1MB no mater how big your file is.

    0 讨论(0)
提交回复
热议问题