Created
July 15, 2015 15:11
-
-
Save RammusXu/cd1fb3eca8d59b6db877 to your computer and use it in GitHub Desktop.
apkDownloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BrowseController < ApplicationController | |
def index | |
path = "public/apk_pool/"+ params[:folder] +"/*" | |
@apks = Dir.glob(path) | |
@apks.each do |apk| | |
puts apk | |
end | |
end | |
def show | |
@path = params[:path] || '/public/apk_pool' | |
@files = Dir.foreach(@path) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
get 'browse/' , to: 'browse#index' | |
get 'browse/:folder' , to: 'browse#index' | |
# get '/browse/*path' => 'browse#show', as: :browse | |
get 'download/index' | |
get 'download/apk_pool' | |
get 'download/file' | |
root 'download#index' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment