Hi, I'm starting to look at uploading images to a web database.
I understand that the first thing I need to use is file_column so that the images are not stored in the database itself, but in the file system. Would I be right in saying that adding security to it (protecting it from prying eyes) would only be a matter of adding a before_filter to the system?
My other main problem is regarding integration of this web database with my Windows application. I want to do something like Picasa (I guess) where people can partially edit the picture on their PC and then click upload to send it to their web album. Does anyone have any references on how data is transferred over HTTP to send and receive image files? I'm reading this right now:
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
but if someone has a better reference, I'd seriously appreciate it.
Hi, I'm starting to look at uploading images to a web database.
What's a web database ?
I understand that the first thing I need to use is file_column so that
the images are not stored in the database itself, but in the file
system. Would I be right in saying that adding security to it
(protecting it from prying eyes) would only be a matter of adding a
before_filter to the system?
No. You have to store images outside RAILS_ROOT/public and use
send_file from controller after validating access.
My other main problem is regarding integration of this web database with
my Windows application. I want to do something like Picasa (I guess)
where people can partially edit the picture on their PC and then click
upload to send it to their web album. Does anyone have any references
on how data is transferred over HTTP to send and receive image files?
I'm reading this right now:
http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
but if someone has a better reference, I'd seriously appreciate it.
You can probably try to use rmagick's to_blob function, then use Zlib
for compression and base 64 encode the data before transferring. But
I'm not sure if that'd improve the performance or not, logically it
should. You can use multipart post form for uploading and proper
content-type in http header for downloading the image.
Hi, I'm starting to look at uploading images to a web database.
What's a web database ?
Sorry, I should have termed it better - I did mean a web-enabled database. So, basically a MySQL database with a Rails app!
I understand that the first thing I need to use is file_column so tha
the images are not stored in the database itself, but in the file
system. Would I be right in saying that adding security to it
(protecting it from prying eyes) would only be a matter of adding a
before_filter to the system?
No. You have to store images outside RAILS_ROOT/public and use
send_file from controller after validating access.
Hmm, OK. Thanks for the pointer, will need to look into this!
My other main problem is regarding integration of this web database with
my Windows application. I want to do something like Picasa (I guess)
where people can partially edit the picture on their PC and then click
upload to send it to their web album. Does anyone have any references
on how data is transferred over HTTP to send and receive image files?
I'm reading this right now:
Forms in HTML documents
but if someone has a better reference, I'd seriously appreciate it.
You can probably try to use rmagick's to_blob function, then use Zlib
for compression and base 64 encode the data before transferring. But
I'm not sure if that'd improve the performance or not, logically it
should. You can use multipart post form for uploading and proper
content-type in http header for downloading the image.
Hmm.. In my case, the client is a C++ program that runs under Windows, so I'm going to have do most of that myself, I guess.. But, if I understand you correctly, what's needed is compression -> base64 encode and use a multipart form and proper content-typing...
Hmm, a bit of a handful, but thanks for the pointers.. time to start looking at these things then!
File column is around and still kicking ass. It may not
be under massivelly heavy development, but what more does it need?
It's had some new features added this year, and it certainly makes
image manipulation stuff (with rmagic) really easy. I'm using it for a
number of production sites, with great success.
File column is around and still kicking ass. It may not
be under massivelly heavy development, but what more does it need?
It's had some new features added this year, and it certainly makes
image manipulation stuff (with rmagic) really easy. I'm using it for a
number of production sites, with great success.
regards,
Craig
www.craigambrose.com
I can sum up my emotion in one word: PHEW!
Cheers
Mohit.