def upload(file, arguments)
      # Call prepareUpload first, to get upload endpoint
      endpoint = get('viddler.videos.prepareUpload')["upload"]["endpoint"]
      
      # Need to use OrderedHash, because the API needs the file argument last
      ordered_arguments = ActiveSupport::OrderedHash.new
      
      arguments.each {|k,v| ordered_arguments[k] = v}
      
      ordered_arguments[:api_key]   = api_key
      ordered_arguments[:sessionid] = sessionid
      ordered_arguments[:file]      = file
      
      JSON.parse RestClient.post(endpoint, ordered_arguments)
    rescue RestClient::ExceptionWithResponse => e
      raise_api_exception e
    end
def upload(file, arguments)
      # Call prepareUpload first, to get upload endpoint
      endpoint = get('viddler.videos.prepareUpload')["upload"]["endpoint"]
      
      # Need to use OrderedHash, because the API needs the file argument last
      ordered_arguments = ActiveSupport::OrderedHash.new
      
      arguments.each {|k,v| ordered_arguments[k] = v}
      
      ordered_arguments[:api_key]   = api_key
      ordered_arguments[:sessionid] = sessionid
      ordered_arguments[:file]      = file
      
      JSON.parse RestClient.post(endpoint, ordered_arguments)
    rescue RestClient::ExceptionWithResponse => e
      raise_api_exception e
    end
Public: Upload a video to the Viddler API.

 file      - The File you are uploading
 arguments - The Hash of arguments for the video
             :title       - The String title of the video
             :tags        - The String of tags for the video
             :description - The String description of the video
             :make_public - The Boolean to make the video public on
                            upload. Please note that if set to false, it
                            will not make your video private.

 Examples

   viddler.upload File.open('myvideo.avi'), :title       => "My Video",
                                            :tags        => "viddler, ruby",
                                            :description => "This is cool"

 Returns a Hash containing the API response.
 Raises ApiException if an error is returned from the API