I use Ruby on Rails, Apache. Faced the problem of uploading a file to the server. I read similar articles here, but it did not help, or my hands are not growing from that place. I use the usual form to send <%= f.file_field :path %>
and the controller:
def upload uploaded_io = params[:article][:path] File.open(Rails.root.join('public','uploads',uploaded_io.original_filename,'wb') do |file| file.write(uploaded_io.read) end end
There is params.require(:article).permit(:path)
The question is, why do not download files larger than 7kb? It is clear that more than 7-10Kb file is stored as a stream, but how to handle it? When you try to download a file larger than 7kb, the cgi script error 500 is generated, and at sizes up to 7kb, everything is fine. I ask for help in explaining. And where did this 7kb limit come from?
Error log: "An error occured in mod_passenger: An error occured while uploading a temporary file in /tmp/passenger.1.0.965717/generation-163/buffered_uploads. This is a directory that should be written to the "PassengerUploadBufferDir" directive to this directory. Not enough permissions to write to the folder folder passengera.