0

I am doing a project which allows user to upload image.
My problem is how can i save the information of image in database MySQL like:
image_path;
image_type;
image_desc:

2 Answers 2

1

There is a gem called Paperclip available. Use it.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks... i already use the Paperclip for uploading now what i want is to save the image information in MySQL database
If you go through the README, it is described that you should add certain fields to you model and say has_attached_file :whatever and so on. Please go through the documentation. It's pretty easy to use.
0

You can use the gem https://github.com/thoughtbot/paperclip. The image_desc you can to save independently.

Image.create(:image => params[:file], :image_desc => params[:desc])

3 Comments

hey! my images are saved in hard disk but i want to save the information regarding that image in database MySQL
I think the image_path you know Rails.root.to_s + "your/path/to/file". File type as paperclip github.com/thoughtbot/paperclip/blob/master/lib/paperclip/…
Not getting your point clearly,like as i save the image in hard disk ,i want its save the information of that image in MySQL like name ,path,type ....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.