Joomla store files in database - joomla

I am using Joomla 2.5
I want to store user uploaded content (like images or general files) in the database instead of in the server.
Is there any existing setting which can be used to do this by default?
Note: I am interested in the user uploaded files. Joomla's own files can stay on the server or on in the database, either is fine by me.

The database doesn't store things like images, its stored information. Images and so on are always stored on the server. The only thing you could do is once an image is uploaded to the server, it stored information about it such as the format, dimensions etc in the database. Would be a good idea to use a gallery such as Phoca Gallery or JoomGallery. More can be found here.
If you are looking for a general file uploader then feel free to use my SWFUpload Component which is only for uploading in the admin backend however is a very simple component therefore will be easy to integrate into other components should you need to.

Related

How Should I store images - Codeigniter

I'm contemplating on how to store images in my new site.
Should I save the images directly to the database
OR
should I upload them to my server, while storing the path in my database?
Also, should it be the second choice, how does one retrieve the path of a file he uploaded previously?
You should definitely go with the second option as you can take advantage of the user's browser caching these images after the initial request. It also means your database wont be hit constantly for large files which is always a bad thing.
In CodeIgniter there are various parameters you can use to get the name / full file path to store in the database.
See http://ellislab.com/codeigniter%20/user-guide/libraries/file_uploading.html
Also take a look at this great SO question Storing Images in DB - Yea or Nay?
I tried CI's own libraries , its good but not best, Image moo solved all my problems, uploading, resize, crop etc..
http://www.matmoo.com/digital-dribble/codeigniter/image_moo/

How to populate image thumbnails (image grid) on my web page using JSP

I wants to populate image thumbnails (image grid) on my web page using JSP. Please suggest the best way. Also please suggest what should I store in the DB, image in binary format or path of the image in text format ?
The correct answer would be It depends on your project requirements
I would like to write my experience, if the images had to be prevented from un-authorized access then database would be a good option, but ASAIK I haven't developed any such application in past 3 years. I would just prefer putting up the images in a folder and then have their name in DB for reference purposes.
I just thing database has more important information to store & retrieve and I don't want to choke the database connections retrieving images.

Is there a way to overwrite existing Blobs in the blobstore

I'm using the high performance image serving feature in App Engine to serve up images from the blobstore. However, I'd like users to be able to modify those images (e.g. rotate, crop etc.) and then write those change back to the blobstore, overwriting the original blob. I know I can write to new blobs in the blobstore, as documented here: http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore
but I don't see a way to overwrite existing blobs. Is this possible in App Engine?
My use case is as follows:
User uploads image, and app engine generates a link via
get_serving_url
The user may then use that link outside of my app, e.g. link to it
on their blog to display the image
If that image is changed later on in my app (rotation, etc.) , I'd
like their image link to reflect those changes
Files stored in blobstore are immutable, once they have been written than can not be changed (only served or deleted).
I think you should try to build your own controller for generate file serving url
- In Datastore each blobFile record have own ID (you manage it) and version ID
- for first upload , set new ID and version
- When user change your image, save new blobstore, keep ID and set new version field
In serving controller generate link by iD, when user call it, get the newest version for serving
It's just my opinion, hope it helpful !

How to cache images and html files in PhoneGap

I need a way for cache images and html files in PhoneGap from my site. I'm planning that users will see site without internet connection like it will be with it. But I see information only about sql data storing, but how can I store images (and use later).
To cache images check out this library -of which I'm the creator-:
imgcache.js
. It's designed for the very purpose of caching images using the local filesystem. If you check out the examples you will see that it can also detect when an image fails to be loaded (because you're offline or you have a very bad connection) and then replaces it automatically with the cached image. The user of the webapp doesn't even notice it's offline.
As for html pages.. if they're html static files, they could be stored locally in the web app (file:// in phonegap).
If they're dynamically generated pages, check the localStorage API if you have a small amount of data, otherwise the filesystem API.
For my web app I retrieve only json data from my server (and process/render it using Backbone+Underscore). The json payload is stored into the localStorage. If the application gets offline, it will fetch json data from the localStorage instead of the server (home-baked fork of Backbone.dualStorage)
You then get the full offline experience: pages+images.
Caching like you might need for simple offline operation is not exactly that easy.
Your first option is the cache manifest. It has some limitations (like the size of the cache) but might work for you since it was designed to do what you want.
Another options is that you can store content on the disk of the device using the file system APIs. This has some drawbacks like security and the fact that you have to load the file from a path / url that is different than you might normally load it from on the web. Check out the hydra plugin for an example of this.
One final option might be to store stuff in localStorage (which has the benefit of being private on all platforms) and then pull it out of there when needed ... that means base64'ing all your images tho so that is a pretty big departure from just standard caching.
Caching is very much possible on Android OS. but on Apple as stated above there are limitations with the size of the images and cache size etc.
If you are willing to integrate and allow the caching on iOS you can use "cache manifest" to do so. but keep the draw backs and limitations in mind.
Also
if you want to save the file to Documents folder under my App, Apple will reject your App. The reason is the system backup all data under Documents folder to iCould after iOS6, so Apple does not allow big data like images or JSON file which could sync from your server again to keep in this folder.
So there is another work around which is good So one can use LocalFileSystem.TEMPORARY instead. It does not save the data to Library/Cache, but it save data to temp folder of App, which does not been auto backup to iCloud and not auto deleted either.
Regards
Rajeev

Drupal: storing images and other module data

Suppose we have a module that displays tables of employees. Each employee has a photo. What is the best way to store this photos and display them?
I mean, is there some kind of content repository in drupal? I don't want to do this manually, maybe there is an API that can store images and then generate links to them and so on.
Thanks.
The Content Construction Kit(CCK) / Fields in core is what you want to explore.
Using CCK you can attach an image, a number field, a file, some text, a reference to content, etc to another piece of content.
In Drupal 7 you can add fields to any entity (Content, User...your custom one(Employee)), in Drupal 6 you might want to explore Content Profile
Further Reading:
http://drupal.org/node/717120
There is a kind of content repository in Drupal: both in the database and as storage (disk).
The API for that is documented in a special File upload section.
If you want inspiration, the core module called upload.module can serve as example. But be aware that Drupal core, for several reasons, is far from the best and cleanest examples to learn from.
What you are looking for is CCK module with file-field and image-field modules for handling the image upload action.
And for the display of those uploaded images you should use Image-cache

Resources