Method: Filemagic::ImageController#upload

Defined in:
app/controllers/filemagic/image_controller.rb

#uploadObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/filemagic/image_controller.rb', line 3

def upload
  file = params["files"][0]

  refile_file = Refile.store.upload(file)

  url = Refile.file_url(Refile.store.get(refile_file.id), :limit, 720, 1280, filename: file.original_filename.downcase)

  return_json = { files: [{ url: url }] }

  render json: return_json, content_type: request.format, status: 200
end