lib/ayadn/fileops.rb in ayadn-1.4.0 vs lib/ayadn/fileops.rb in ayadn-1.4.1
- old
+ new
@@ -41,10 +41,11 @@
end
end
def self.upload(path, token)
begin
- file = Regexp.escape(path).gsub!('\.', '.')
+ temp = Regexp.escape(path).gsub('\.', '.')
+ file = temp.gsub('\-', '-')
case File.extname(path).downcase
when ".png"
`curl -k -H 'Authorization: BEARER #{token}' https://api.app.net/files -F 'type=com.ayadn.files' -F "content=@#{file};type=image/png" -F 'public=true' -X POST`
when ".gif"
`curl -k -H 'Authorization: BEARER #{token}' https://api.app.net/files -F 'type=com.ayadn.files' -F "content=@#{file};type=image/gif" -F 'public=true' -X POST`