You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: uploaded_file.rb
    path of file: ./repos/rack-test/lib/rack/test
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'fileutils'
require 'tempfile'
require 'stringio'

module Rack
  module Test
    # Wraps a Tempfile with a content type. Including one or more UploadedFile's
    # in the params causes Rack::Test to build and issue a multipart request.
    #
    # Example:
    #   post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg
    
      def initialize_from_file_path(path)
        raise "#{path} file does not exist" unless ::File.exist?(path)

        @original_filename ||= ::File.basename(path)
        extension = ::File.extname(@original_filename)

        @tempfile = Tempfile.new([::File.basename(@original_filename, extension), extension])
        @tempfile.set_encoding(Encoding::BINARY)

        FileUtils.copy_file(path, @tempfile.path)
      end
    end