3

We're using a third party web service that POSTS multipart data (a file) back to us. But it ALSO passes an extra param via the url http://ourdomain.com/theposturl?extra=good

the 'filename' object with :filename and :tempfile for the binary data are in params[]

but how do we get the "good" off of the url?

post /theposturl
  puts params.inspect    # this shows a hash with filename, 
                         # :filename and :tempfile as expected

  extra_param = ??????[:extra] # but what lets us 'read' the ?extra=good off the url

end
jpw
  • 18,697
  • 25
  • 111
  • 187

1 Answers1

10

You need to use a string as the hash key.

extra_param = params["extra"]
thargor
  • 453
  • 3
  • 11
  • I would swear that on Sinatra when I "puts params.inspect" I didn't see the url param, only the params embedded in the post data. I'll doublecheck that, thanks! – jpw Feb 17 '11 at 04:36