Closed nerg4l closed 5 years ago
What the state? Is it implemented?
I did not have time yesterday to resolve the conflicts. Despite that it is finished.
ok, I can make resolve conflicts when I have free time. Is there any necessary js changes I need to make? (to test the feature)
Enable testChunks
You can find a detailed description about the property here.
The point is, it will send a GET
request to the same url where it sends the POST
.
$('#fileupload').fileupload({
maxChunkSize: 10000000, // 10 MB
add: function (e, data) {
var that = this;
var f = data.files[0];
$.getJSON('server/php/', {file: f.name, size: f.size}, function (result) {
data.uploadedBytes = result.size;
$.blueimp.fileupload.prototype
.options.add.call(that, e, data);
});
}
});
A simmilar example can be found here, the difference is you have pass the size of the file, because it is used by the handler to create a unique filename and also the size property is in the base response not under a file property.
This is really simmilar to 23/resumable.js
as you can see here. And according to the documentation both treats 204 No content
response the same way. Only the name of the parameters are changed.
It has a resumeSizeUrl
property. You can find an example here.
Same thing applies here as on jQuery-File-Upload
, which means you have to pass the size too, not just the filename.
resumeSizeUrl: '/uploaded/size/url?file=' + file.name + '&size=' + file.size
The way I implemented the HandlerFactory isn't the best. I'll think about a better way. If you have an idea or suggestion I would appreciate it.
Hi! I'm very interested in this functionality.
Are there any news about this merge request? Thanks!
I'm also interested in this feature.
@rluders I made a temporary solution that is working with no issues: https://github.com/pionl/laravel-chunk-upload/issues/10#issuecomment-448615836
Hi @nerg4l, should I find the time to check your feature? Did you finally use it in production?
This implementation is very hacky and I decided to ditch it. With the current logic of the request handling it is really hard to distinguish between the frontend libraries when the norm of this library is to rely on the parameters/headers.
I started working on a different implementation to make it simpler with using drivers. My current work is available here: https://github.com/LaraCrafts/laravel-chunk-uploader
I see you improved the ideas -- the separation between handle / saver is not ideal I would definitely used different approach now. It could get a rewrite but to late know :)
This resolves #10
I welcome any recommendation about my code.