简体   繁体   中英

PHP- Upload files in chunks

I am using fineuploader to upload files to AWS S3 , I have around 200-300 files of minimum 5MB each. It is taking too much to uplaod files there. I have been looking into the documentation but there is no way to upload the files in chunks to S3 , How can I optimize my upload?

$('#fine-uploader-gallery_videographer').fineUploader({
                    template: 'qq-template-gallery',
                    button: $('#uploadAttachments'),
                    dragAndDrop: {
                        extraDropzones: [$('.drag-drop-main')]
                    },
                    request: {
                        endpoint: '/videographer/upload-photos',
                        params: {
                            _token: $('#vg_token').val(),
                            client_id: $('#client_id').val(),
                            baby_id: $('#baby_id').val(),
                            session_id: $('#session_id').val()
                        }
                    },
                    thumbnails: {
                        placeholders: {
                            waitingPath: '/assets/images/pics/9.jpg',
                            notAvailablePath: '/assets/images/pics/9.jpg'
                        }
                    },
                    validation: {
                        allowedExtensions: ['jpeg', 'jpg', 'gif', 'png', 'mp4', 'mov', 'avi']
                    },
                    callbacks: {
                        onUpload: function (id, name) {
                            if ($('#fine-uploader-gallery .qq-upload-list li').length > 0) {
                                $('#fine-uploader-gallery').show();
                            } else {
                                $('#fine-uploader-gallery').hide();
                            }
                        },
                        onCancel: function (id) {
                            if ($('#fine-uploader-gallery .qq-upload-list li').length > 1) {
                                $('#fine-uploader-gallery').show();
                            } else {
                                $('#fine-uploader-gallery').hide();
                            }

                        },
                        onAllComplete: function () {
                            location.reload();
                        }

                    }
                });

It is taking too much to uplaod files there

You have two options:

  1. Increase the bandwidth of your internet connection
  2. Increase the maxConnections option to 6 .

Option 1 is the best option. Option 2 may help a bit, but probably not much if your bandwidth is the bottleneck. All browsers have a limit on the number of concurrent HTTP requests they can send. This number is usually around 6, which is where option 2 comes from. This will tell Fine Uploader to send, at most, 6 requests at once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM