def policy_document
      @policy_document ||=
        Base64.encode64(
          MultiJson.dump(
            {
              expiration: 10.hours.from_now.utc.iso8601(3),
              conditions: [
                { bucket: options[:bucket] },
                { acl: options[:acl] },
                { success_action_status: '201' },
                ["content-length-range", 0, options[:max_file_size]],
                ["starts-with", "$utf8", ""],
                ["starts-with", "$key", ""],
                ["starts-with", "$Content-Type", ""]
              ]
            }
          )
        ).gsub(/\n/, '')
    end
def policy_document
      @policy_document ||=
        Base64.encode64(
          MultiJson.dump(
            {
              expiration: 10.hours.from_now.utc.iso8601(3),
              conditions: [
                { bucket: options[:bucket] },
                { acl: options[:acl] },
                { success_action_status: '201' },
                ["content-length-range", 0, options[:max_file_size]],
                ["starts-with", "$utf8", ""],
                ["starts-with", "$key", ""],
                ["starts-with", "$Content-Type", ""]
              ]
            }
          )
        ).gsub(/\n/, '')
    end
generate the policy document that amazon is expecting.