Code Monkey home page Code Monkey logo

Comments (6)

tomoko523 avatar tomoko523 commented on May 16, 2024

これで実装できそう。使い方について調査する。

Returns the file extension (e.g. zip, pdf) of this link's (internal or external) target. Returns an empty string if the file extension is can not be determined.

# File 'lib/scrivito/link.rb', line 118
def file_extension
  if internal?
    obj ? obj.file_extension : ""
  else
    path = URI.parse(url).path rescue nil
    path.blank? ? "" : File.extname(path)[1..-1] || ""
  end
end

http://www.rubydoc.info/gems/scrivito_sdk/0.50.1/Scrivito%2FLink%3Afile_extension

from coderdojo.jp.

tomoko523 avatar tomoko523 commented on May 16, 2024

できた。
aリンク先にダウンロードしたいzipを紐づけるとできます。

2016-12-15 12 07 38

2016-12-15 12 08 02

2016-12-15 12 04 54

from coderdojo.jp.

tomoko523 avatar tomoko523 commented on May 16, 2024

@yasulab
↑この場合ダウンロード素材がscrivito側のサーバに保存されますが、
この点については問題ないですが?

from coderdojo.jp.

yasulab avatar yasulab commented on May 16, 2024

@tomoko523 ダウンロード素材は CC BY-NC 4.0 Internaional で公開することになっているので大丈夫です! 👌

また、Scrivito 側にあるとホスティング的な側面から見ても安心できそう 😊 (負荷が分散されるので)

from coderdojo.jp.

tomoko523 avatar tomoko523 commented on May 16, 2024

@yasulab ありがとうございます!
この対応は実装を直すことはないので、このままCloseしてしまいますね。

(/sotechsha-gazou)に実装例を載せています。

from coderdojo.jp.

yasulab avatar yasulab commented on May 16, 2024

この対応は実装を直すことはないので、このままCloseしてしまいますね。

了解です! 👌 お疲れ様でした〜♨️

from coderdojo.jp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.