softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

When creating a ticket with attached file, the file is still encoded when downloaded from the web ui #91

Open raulcabero opened 9 years ago

raulcabero commented 9 years ago

I use the following code to create the ticket

username = 'set me'
key = 'set me'

path = "C:\\test.xlsx"
name = "framework.xlsx"

contents = 'Test Ticket Please Close at your earliest convenience'

file = File.open(path,'rb') { |io| io.read }
encode = Base64.encode64(file)

attachedFiles = [
{
'data' => encode,
'filename' => name
} 
]

template = {
'subjectId' => 1522,
'contents' => contents,
'assignedUserId' => 205832,
'title' => "Test Ticket Please Close at your earliest convenience"
}

client = SoftLayer::Client.new( :username => username,:api_key => key)
ticket_service = client['SoftLayer_Ticket']

new_ticket = ticket_service.createStandardTicket(template, contents, 0, '', '', '', attachedFiles)

but when I download the file from the softlayer's portal the file is still encoded