Upload all files as binary to prevent corrupt images
This commit is contained in:
parent
8226bba8b3
commit
774e656cfa
1 changed files with 2 additions and 13 deletions
|
@ -27,10 +27,8 @@ module Middleman
|
||||||
filtered_files.each do |filename|
|
filtered_files.each do |filename|
|
||||||
if File.directory?(filename)
|
if File.directory?(filename)
|
||||||
upload_directory(ftp, filename)
|
upload_directory(ftp, filename)
|
||||||
elsif File.binary?(filename)
|
else
|
||||||
upload_binary(ftp, filename)
|
upload_binary(ftp, filename)
|
||||||
else
|
|
||||||
upload_file(ftp, filename)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -85,16 +83,7 @@ module Middleman
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_file(ftp, filename)
|
|
||||||
begin
|
|
||||||
ftp.puttextfile(filename, filename)
|
|
||||||
rescue Exception => exception
|
|
||||||
handle_exception(exception, ftp, filename)
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "Copied #{filename}"
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue