Audio Upload: File smaller than cap but rejected because too large

31 views
Skip to first unread message

Ben Stutsky

unread,
May 5, 2015, 9:21:38 PM5/5/15
to tumbl...@googlegroups.com
I finally got things working enough to oauth and queue posts in ruby. However, when uploading a 5MB audio file I keep getting a file too large error... The audio file cap is 10MB so I am not sure why this is happeneing. Below is my code:


require "uri"
require 'net/http'
require "oauth"
require 'open-uri'

#
#Secrets Omitted
#

@consumer = OAuth::Consumer.new(
        CONSUMER_KEY
,
        SECRET_KEY
,
       
{ :site => 'http://www.tumblr.com',
         
:request_token_path => '/oauth/request_token',
         
:authorize_path => '/oauth/authorize',
         
:access_token_path => '/oauth/access_token',
         
:http_method => :get
       
}
     
)
@access_token = OAuth::AccessToken.new(@consumer, USER_CONSUMER_KEY, USER_SECRET_KEY)
@res = @access_token.post("http://api.tumblr.com/v2/blog/XXXXXXXXX.tumblr.com/post",
   
{
   
:type => 'audio',
   
:state => 'queue',
   
:data => URI::encode(File.binread("XXXXXXXXXX/file.mp3"))
   
})




Reply all
Reply to author
Forward
0 new messages