# Rflickr: invalid auth token when uploading

**URL:** <https://www.ruby-forum.com/t/rflickr-invalid-auth-token-when-uploading/92289>\
**Category:** Rails\
**Created:** [April 17, 2007, 8:44pm UTC](https://www.ruby-forum.com/t/rflickr-invalid-auth-token-when-uploading/92289 "2007-04-17T20:44:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuart\_updegrave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@stuart\_updegrave](https://www.ruby-forum.com/u/stuart_updegrave)\
**Post date:** [April 17, 2007, 8:44pm UTC](https://www.ruby-forum.com/t/rflickr-invalid-auth-token-when-uploading/92289/1 "2007-04-17T20:44:12Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi, I’m working on an application which uses rflickr to upload images to  
flickr. I’ve generated and cached an auth token as described in the  
GETTING STARTED document in the rflickr tree. However, when I call the  
API, I receive an error stating “ERR: Invalid auth token (98)”. The  
extended error is:

XMLRPC::FaultException (Invalid auth token):  
/vendor/plugins/rflickr-2006.02.01/lib/flickr/upload.rb:70:in  
`error' /vendor/plugins/rflickr-2006.02.01/lib/flickr/upload.rb:179:in `upload\_image’

Any insight into this error will be greatly appreciated.

Here is the action that gets executed on an upload request:

def upload  
incoming\_file = params[‘flickr\_image’]  
content\_type = incoming\_file.content\_type.chomp  
msg\_out = nil

```
responds_to_parent do
  render :update do |page|
    if content_type.rindex(/image\/[(jpe?g)||(gif)||(png)]/)
      cache_file = "#{RAILS_ROOT}/public/cache/flickr.cache"

      if File.exist? cache_file
        flickr = Flickr.new(cache_file)

        msg_out = flickr.photos.upload.upload_image(
          incoming_file,
          content_type,
          incoming_file.original_filename,
          params[:flickr_title],
          params[:flickr_description],
          params[:flickr_tags].scan(/"[\w]+"|\w+/).collect{ |tag|

```

tag.gsub( /"/, ‘’ ) }  
)  
end  
else  
page.alert “Please upload an image file.”  
end  
end  
end  
return  
end

When I inspect the flickr object, I get the following:

“#\<Flickr:0xb5c2dfac @person\_by\_nsid={}, @test=nil, @shared\_secret="",  
@interestingness=nil, @reflection=nil, @photosets=nil, @api\_key="",  
@favorites=nil, @auth=nil, @caching=true,  
@client=#\<XMLRPC::Client:0xb5c2de30 @http\_header\_extra=nil,  
@proxy\_port=nil, @parser=nil, @proxy\_host=nil, @host="www.flickr.com",  
@create=nil, @auth=nil, @user=nil, @port=80, @use\_ssl=false,  
@cookie=nil, @http=#\<Net::HTTP [www.flickr.com:80](http://www.flickr.com:80) open=false\>,  
@password=nil, @timeout=30, @http\_last\_response=nil,  
@path="/services/xmlrpc/"\>,  
@endpoint="[http://www.flickr.com/services/xmlrpc/\](http://www.flickr.com/services/xmlrpc/%5C)”, @photos=nil,  
@groups=nil, @auth\_mode=true, @photoset\_by\_id={}, @ticket\_by\_id={},  
@contacts=nil, @blog\_cache=nil, @group\_by\_id={}, @urls=nil,  
@token\_cache="/cache/flickr.cache", @license\_cache=nil,  
@photopool\_by\_id={}, @people=nil, @async=false, @photo\_by\_id={},  
@blogs=nil\>"  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.3 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iD8DBQFGJRVHMWQ3q1LZ8AcRAifOAKCIs55nmEg2U7301Z8kpPbM13TXKACdFcvC  
k98aggkSa/zD5XNXAlRx45A=  
=qcPW  
-----END PGP SIGNATURE-----
