i trying list video file in local system. have used code it.
def brows_video_files_from_a_directory if params[:file_directory] two_dimentional_array = [] combined = [] file_directory = params[:file_directory] dir.glob(file_directory + "/*.{mov,mp4,flv,mkv,avi,wmv,mpg,mpeg,3gp}").each.with_index |item, index| @file_details = two_dimentional_array << create_array_of_data(item, combined) end end end http://i.stack.imgur.com/m7jie.png <- check screenshot
it works fine in local system (http://localhost:3000/) after push server trying fetch directory server not local machine , there way list files local machine
the server code run on server machine, , code allows read files local filesystem.
if want read files computer different server, need use protocol allows access filesystem of remote computer.
you can make ssh connection server local computer, , able run commands though ssh connection.
you can use other protocols, such ftp, smb, ...
Comments
Post a Comment