Download image from database to project folder (Paperclip) - ruby-on-rails

I want to download an image stored in database with paperclip and put it in my project folder. In app/assets/images for example.
Do you now a way in order to do that ?

Related

active storage - how to modify file and resave it

I am trying to modify uploaded file once it is uploaded but I want to modify it (e.g. do some imagemagick operations on it).
I was trying to download file into tmp directory, modify file and then re-upload it.
Is there a nice way to do this?

Upload folder using filepond

I am trying add a functionality of uploading a folder using filepond but there is no such documentation for such,so how to upload a folder using filepond?

Upload multiple files in one shot

I'm currently using the file watchers features to generate a minified version of the file each time I modify a css file and I would like to be able to upload BOTH files at the same time.
Is there any way to link those files so I don't need to upload both of them manually ? I don't want them to be uploaded automatically though, only when I explicitly want it (upload to).
To be more specific, I need PhpStorm to upload
main.min.css
when I manually upload
main.css

Displaying image in rails from a different folder

How could I display an image from a folder other than images folder under the app/assets?
Suppose I have another folder called im under assests. i.e app/assets/im and I need to display an image under the im folder with the name same as an image under the images folder, how could I do it?
If you are using Asset Pipeline, all folders (not in the pre-compilation path) will be copied to the public/assets folder.
To access the asset, simply do asset_url("im/image_name.png"). This will fetch your image.

Automatically copy new folder contents to another folder after upload

Is there any way a new image upload from a PHP form sent to directory a can be copied to directory b after it has been uploaded? In this case it's not possible to alter the upload path itself or copy it during upload so I'm looking for some kind of automatic replication of new directory contents into another directory after the file has been uploaded.
Is there an automated service/script that can move the content of one directory on our server to another directory? We upload files to www.mysite.com/upload/thumb for example but need them to be moved automatically to www.mysite.com/cs/upload/thumb - is this possible without running a move_uploaded_file PHP script (I would prefer it to be done by the server because we use the same page for many different landing page functions).
do you look for copy (http://php.net/manual/en/function.copy.php)?

Resources