I am working on hybrid mobile application in which I have a scenario to store images in to oracle database through web-API. I can get the images as base-64 encoded from API. So how can i save them to database and what datatype should I use to store them
If you want to insert image you can use BLOB data type . about how storing pictures in database check storing pic and photos and how to store image
Related
Hello
I am working on codeigniter project.
And my question is that : Is it possible to store image as cookie ??
If yes then can please you provide me some documentation or examples on it?
A cookie is a short piece ox text that is stored on the user's computer. Typically it will be no more than 4096 bytes (the lower limit specified by RFC2109). If you can compress and base64 encode an image into this then it might be possible to store an image, but it will be a small image indeed!
There are many ways to tackle the situation,
1.Encode the image to string and store the string to a cookie, but the size limit is 4kb
2.Store the image link to a cookie, but it should either located in our server or the image must be in the internet for locating.
3.Use HTML5 to store images locally HTML5 code example: Intelligently store Images in localStorage for faster page loads!
i have not tried this but i think if you use codeigniter sessions - with a session database table - then you might be able to store the image in the session db table. when you use a session table, codeigniter only stores an ID in the users cookie.
http://ellislab.com/codeigniter/user-guide/libraries/sessions.html
I capture images within my app and need to store them. I'm not sure where the right place is to store the captured image. Storing the image as byte array in the database would be very nice but whats happening if the next-gen smartphones getting a high-resoltion camera and the images become bigger? Are they exceeding my database limit or my app becomes slowly?
Is it better to store the image into IsoStore?
I'd store in the isostore, if you want to use database, you might just store the path of the image or name to be able to find it from the isostore.
It should be faster to use isostore instead of database.
If you want to store image in database use blob type attribute in database,
Convert the image in byte-array and execute the database command.
To convert the object in byte array follow the link.
This answer is based on sqlite database.
I want to use Prawn or PDFkit library for generating PDF into my Rhomobile application.
Please suggest the process.
I was using pdf_writer which is supported by Rhomobile but there are issues including images in the generated pdfs.
Plz help
Adding image with using pdf_writer is possible but using tricky way. first you need to store that image in DB as a blob data, then through query you need to fetch blob data from that table and need to print that blob data on PDF.
Note : this is only applicable for for raw RGB formatted images.
How to add image (as BLOB Type) without using query in SQLite (SQLiteAdmin tool) table?
I was reading on internet these statements about SQL Server data types:
VARBINARY(MAX) - Binary strings
with a variable length can store up
to 2^31-1 bytes.
IMAGE - Binary strings with a
variable length up to 2^31-1
(2,147,483,647) bytes.
Is there a really big technical difference between VARBINARY(MAX) and IMAGE data types?
If there is a difference: do we have to customize how ADO.NET inserts and updates image data field in SQL Server?
They store the same data: this is as far as it goes.
"image" is deprecated and has a limited set of features and operations that work with it. varbinary(max) can be operated on like shorter varbinary (ditto for text and varchar(max)).
Do not use image for any new project: just search here for the issues folk have with image and text datatypes because of the limited functionality.
Examples from SO: One, Two
I think that technically they are similar, but it is important to notice the following from the documentation:
ntext, text, and image data types will be removed in a future version of MicrosoftSQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.
Fixed and variable-length data types for storing large non-Unicode and Unicode character and >binary data. Unicode data uses the UNICODE UCS-2 character set.
They store the same data: this is as far as it goes.
"image" is deprecated and has a limited set of features and operations
that work with it. varbinary(max) can be operated on like shorter
varbinary (ditto for text and varchar(max)).
Do not use image for any new project: just search here for the issues
folk have with image and text datatypes because of the limited
functionality.
In fact, VARBINARY can store any data that can be converted into a byte array, such as files, and this is the same process that IMAGE data type uses, so, by this point of view, both data types can store the same data.
But VARBINARY have a size property, while IMAGE accepts any size up to the data type limits, so when using IMAGE data type, you will spend more resources to store the same data.
In a Microsoft® SQL Server®, the IMAGE data type is really deprecated, then you must bet in VARBINARY data type.
But be carefull: The Microsoft® SQL Server® CE® (including the latest 4.0 version) still using IMAGE data type and probably this data type will not "disappears" so soon, because in Compact Edition versions, this data type is better than any other to fast files storage.
I inadvertently found one difference between them. You can insert a string into an image type but not into a varbinary. Maybe that's why MS is deprecating the image type as it really doesn't make sense to set an image with a string.