This line of rubypress code:
:type => MIME::Types.type_for(FILENAME).first.to_s,
is barfing with the following error:
NameError: uninitialized constant MIME
The whole block is:
FILENAME='myFile.png'
wp.uploadFile(:data => {
:name => FILENAME,
:type => MIME::Types.type_for(FILENAME).first.to_s,
:bits => XMLRPC::Base64.new(IO.read(FILENAME))
})
Any suggestions what the problem is?
Add require 'mime/types' to the top of your file.
extension = File.extname(file).split(".")[1]
Mime::Type.lookup_by_extension(extension)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With