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