def create_deposition_file(options={})
      id = options[:id] || raise(ArgumentError, "Must supply :id")
      file_or_io = options[:file_or_io] || raise(ArgumentError, "Must supply :file_or_io")
      filename = options[:filename]
      content_type = options[:content_type]

      content_type = MIME::Types.type_for(file_or_io).first.content_type if content_type.blank?
      io = Faraday::UploadIO.new(file_or_io, content_type, filename)
      filename = File.basename(file_or_io) if filename.blank?
      Resources::DepositionFile.parse(
        request(:post, "deposit/depositions/#{id}/files", { name: filename, file: io },
          "Content-Type" => "multipart/form-data")
      )
    end
def create_deposition_file(options={})
      id = options[:id] || raise(ArgumentError, "Must supply :id")
      file_or_io = options[:file_or_io] || raise(ArgumentError, "Must supply :file_or_io")
      filename = options[:filename]
      content_type = options[:content_type]

      content_type = MIME::Types.type_for(file_or_io).first.content_type if content_type.blank?
      io = Faraday::UploadIO.new(file_or_io, content_type, filename)
      filename = File.basename(file_or_io) if filename.blank?
      Resources::DepositionFile.parse(
        request(:post, "deposit/depositions/#{id}/files", { name: filename, file: io },
          "Content-Type" => "multipart/form-data")
      )
    end
Create (upload) POST deposit/depositions/:id/files
 Upload a new file.
 Note the upload will fail if the filename already exists.
 @param [Hash] options The options to create a deposition file with.
 @option options [String, Fixnum] :id A deposition's ID.
 @option options [String, IO] file_or_io The file or already open IO to upload.
 @option options [String] filename The name of the file (optional except when an IO).
 @option options [String] content_type The content type of the file (optional except when an IO).
 @raise [ArgumentError] If the :id or :file_or_io arguments are blank.
 @return [Zenodo::Resources::DepositionFile].