ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -


i trying rename upload image

permission denied @ sys_fail2 - (d:/ror/projects/grp/public/uploads/gallery/test.jpg, d:/ror/projects/grp/public/uploads/gallery/qinsnvzicc20160509132021.jpg) 

my code :

photo = params[:gallery][:gal_img] name = photo.original_filename directory = "#{rails.root}/public/uploads/gallery/" path = file.join(directory, name)  uniq_name = (0...10).map { (65 + rand(26)).chr }.join time_footprint = time.now.to_formatted_s(:number) file.open(path, "wb") |file|   new_file_name = uniq_name + time_footprint + file.extname(file)   file.write(photo.read)   @uniq_path = file.join(directory, new_file_name)   file.rename(file, @uniq_path) end 

i have checked , giving privilege in ruby directory.

please let me know why getting permission denied error?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -