Вопрос

I'm trying to build an HTML5 file uploader that supports large files via chunks. I've found enough documentation online to work with the frontend side of things but I see zero info about how to reconstruct the chunks once they hit the server (I'm using Rails.) Any help?

Это было полезно?

Решение

So you have multiple files containing a chunk of the large file? Then just do

File.open("file", "w") do |large_file|
  %w(file1.chunk file2.chunk file3.chunk).each do |chunk| # %w() creates an Array
    large_file.write(File.read(chunk))
  end
end
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top