Answer the question
In order to leave comments, you need to log in
How to implement upload txt file in Rails?
Hello.
How to implement upload txt file from local computer folder in Rails project? Nothing was googled ... Can you tell me a gem or can it be somehow implemented using standard tools? I want to first understand the example of one file, but ideally, you need to implement the uploading of all files from a local folder, followed by processing each file. I hope for the help of the local gurus)
Answer the question
In order to leave comments, you need to log in
Dir.glob("/path_to_folder/*.txt") do |text_file|
File.open(text_file, "w+") do |f|
#обработка файла
end
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question