سؤال

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