Where to store images in webapp?

Hello.
I'm designing an web application which main purpose is to store and view images that users has stored.
I'm considering that where is the best place to store those images? I have at least two options: relational database or filesystem. Is it bad idea to store images in database? What are the downsides?
The user's images has to be seen only by the user itself, that is to say others should not get the user's private images. How this can be made by filesystem? I have thinking some kind of "ImageServlet" to where you pass image's id by parameter and the servlet checks that the requester has priviledges to fetch the image eg. is the owner of the image (fetching userinformation from the session). The application will have also a feature that the user can "share" some images to known persons. The "ImageServlet" can fulfil that requirement also.
Am I in right direction or does somebody have a better idea?
-Robert-

Ok maybe I do the matrix and consider the things that have been came up.
I was wondering one thing. If I choose store images in database, what about db connections? Them are anyway resources that are always scarce even if there is connection pool in use. Could that be stumbling block? Because the application's nature is, that there can be lots of pictures, users create picture albums and can view them later.
Nevertheless, I still think that I need to design some kind of "ImageServlet" to get the pics. I was wondering something like this:
In JSP/HTML page images are referenced by img tag like this
    <IMG src="ImageServlet?name=pic1" width=... height=...><BR/>
    <IMG src="ImageServlet?name=pic2" width=... height=...>
    <!-- etc -->In ImageServlet pics are served eg. like this (this is just example to show what I'm thinking)
    // check if user have rights to access to pic
    checkUserRights();
    resp.setContentType(...);
    resp.setContentLength(...);
    // imageStore could fetch the image from database or filesystem
    InputStream picStream = imageStore.getImage(req.getParameter("name"));
    OutputStream out = resp.getOutputStream();
    byte[] buf = new byte[1024];
    int count = 0;
    while ((count = pic.read(buf)) >= 0) {
      out.write(buf, 0, count);
    pic.close();
    out.close();Is there some drawbacks, if pics are sent to requester using OutputStream?

Similar Messages

  • Where to store pictures?

    Iam using this version of SDK:
    Product Version: Java(TM) ME Platform SDK 3.0
    Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
    System: Windows Vista version 6.0 running on x86; Cp1252; en_US (cdctoolbar)
    Userdir: C:\Users\Azmath\javame-sdk\toolbar\3.0
    I want to know where to store images so that i can access them using the create image function... u know createImage("/a.gif");
    where do i store 'a.gif' ? in which folder?

    According to the Java-doc, writing
    myImage = Image.createImage("/a.png");as Azzy is doing should result in the same thing as
    myImage = Image.createImage(HelloMIDlet.class.getResourceAsStream("/a.png"));From the javadoc:
    public static Image createImage(String name) throws IOException
    Creates an immutable image from decoded image data obtained from the named resource. The name parameter is a resource name as defined by Class.getResourceAsStream(name).

  • Where does Firefox store images saved as desktop wallpaper?

    Where does Firefox store images saved as desktop wallpaper? i was playing around with windows theme and I can't find the wallpaper that was displayed before.

    Firefox saves downloads to wherever you specify. Check your settings in Tools > Options > General, Download section. If you have it set to "Always ask me where to save files", then only you know where they were saved.
    See: http://support.mozilla.com/en-US/kb/Options+window+-+General+panel
    Also see: http://www.sevenforums.com/tutorials/281-desktop-background-change.html
    <u>'''''Other Issues'''''</u>: ~~red:You have installed plug-ins with known security issues. You should update them immediately.~~
    <u>'''Install/Update Adobe Flash Player for Firefox (aka Shockwave Flash)'''</u>: your ver. 10.0 r45; current ver. 10.1 r53 ('''important security update 2010-06-10''')
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash Updating Flash]'''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    -exit Firefox (File > Exit)
    -check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -double-click on the Adobe Flash installer you just downloaded to install/update Adobe Flash
    -when the Flash installation is complete, start Firefox, and test the Flash installation here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507&sliceId=1
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version of Flash. To install/update the IE ActiveX Adobe Flash Player, same instructions as above, except use IE to download the ActiveX Flash installer.
    *Also see: http://kb.mozillazine.org/Flash ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]
    <u>'''You'''</u> ~~red:<u>'''MAY'''</u>~~ <u>'''need to Update Adobe Reader for Firefox'''</u>: your ver. N/A; current ver. 9.3.3 (important security update release 06-29-2010; see: http://www.adobe.com/support/security/bulletins/apsb10-15.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: http://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox#Installing_and_updating_Adobe_Reader
    ''<u>You may be able to update from the Adobe Reader installed on your system</u>'' instead of going to the Adobe site and downloading. Start > Program Files, find and click Adobe Reader to open, click Help, click Check for Updates.
    ''<u>If you go to the Adobe site to download the current Adobe Reader:</u>''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    ~~red:-See the images at the bottom left of this post to see the steps to take on the Adobe site~~
    -exit Firefox (File > Exit)
    -check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -double-click on the Adobe Reader installer you just downloaded to install/update Adobe Reader
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version. To install/update the IE ActiveX version, same instructions as above, except use IE to download the ActiveX installer.
    *Also see: http://kb.mozillazine.org/Adobe_Reader ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]

  • Snow Leopard (10.6.8) Web Browser, App Store, iTunes Store image won't finish loading.

    Hello,
    I've recently upgraded from Leopard to Snow Leopard by clean installing. Once I upgraded to Snow Leopard (10.6.3) everything seemed to work perfectly except for the new keyboard that I purchased (requires upgrade to 10.6.8). So as I upgraded to 10.6.8 by "Software Update…".
    Once the update was completed and the machine restarted I've noticed when I opened opened couple of common sites in Safari (such as: Flickr, YouTube, and Amazon) and some of the images won't finish loading with a "?" in the middle where the image would be and browser assumes that the site was done loading. First I thought this was a refresh problem so I hit refresh on the browser but nothing really happened. I thought this was strange so I decided to download Google Chrome and Firefox to try it out as well. Same situation as well… Then I opened  the App Store and iTunes Store and the same things happened there as well. I'm assuming that all these images exists online so anything that access the web to load images will just crap out. One odd thing is that this problem don't seem to happen on any of the sites on Apple when I view it in the web browsers.
    I couldn't figure out the reason so I decided to reinstall Snow Leopard (10.6.3) again by cleaning out the hard drives as before. Once it finished installing I opened up iTunes Store and Safari and the images loads fine. So went ahead (crossing my fingers) to "Software Updates…" to 10.6.8 and the the problem happened again.
    I naively went ahead and tried to clean installing it again, thinking "Third time is the charm!" But same situation once I upgrade to 10.6.8. After the third time I let the browser sit there after it didn't load those images. I waited about five minutes and hit refresh and the images loaded. This happened the same with App Store and iTunes Store images as well. This is very odd because my interment connection hasn't been a changed before I upgraded to 10.6.8. Seems like browsers just cuts off the loading time of the whatever that's lagging instead on that site.
    Is there a solution in the preferences for this or is this some kind of a bug that I'm having with my OS disc or network card? I don't think this has nothing to do with my modem or my interment service because it was working fine before I upgraded to 10.6.8.

    I get that same problem too-you could try checking your network settings, release and renew your IP address, see if that helps. There is a tweaking menu you can get in Firefox that can help somewhat (google Firefox tweaks) but you'd have to raise the hood in FF and tinker a bit, but it does help. How much RAM do you have on your Mac Pro?, also update your Java and shockwave
    sorry I can't be of more help
    Jon B

  • Can we use BLOB fields (that store images) in Crystal Report ?

    I'm developing with ASP.NET, VS.NET 2003.
    Using Crystal Report for VS.NET
    DataBase: Oracle 10g
    I store a BLOB field in a table. This field store images, like jpg files.
    The Stored Procedure that I use to fill the report is:
    OPEN MyCursor FOR
    SELECT MyId , MyImg
    FROM MyTable
    MyImg is BLOB field
    However, when I try to use the stored procedure in Crystal Report at design mode, any field can be displayed and then drag and drop to the report, but MyImg is not possible.
    There is an error message:
    Details: ADO Error Code: 0x80004005
    Source: Microsoft OLE DB Provider for Oracle
    Description: Data type is not supported
    I'm afraid that is not so easy for me to change DB connector drivers.
    My question is:
    - Is it possible to use BLOB fields in Cyrstal Reports?
    - Or should I convert them previously to something, so they can be displayed in Crystal Report at desing mode ?
    - If I should change DB connector drivers, which one should I use and from where should I download it and then install it in my Web Server?
    Thank you very much!

    Hi,
    I dont know much at all about CR, but I do know Microsoft's OLEDB Provider for Oracle doesnt support Blob datatype.. http://support.microsoft.com/kb/q244661/
    Oracle's OLEDB provider does though, you can get it as part of the ODAC download on OTN.
    Hope that helps,
    Greg

  • How do I store images in a jar file to be displayed on a jsp?

    Afternoon all,
    I have created a java component which accepts some parameters and returns a string. The returned string contains html tags to display a table in a webpage when rendered through a browser.
    I want to be able to add this component to any java web project to display my table. The problem is that I want to use images in my table to give the appearance of curved corners.
    How do I store images in my component and render to a webpage?
    Thanks in advance,
    Alex

    You won't be able to make the install of this library as simple as the installation of a jar file. You can't access the images directly in the jar.
    There are a few approaches you can take:
    1 - jar file + resources:
    Have the install as being a jar and a "resources" directory which you store all the images in. Thus the images become part of the web application/web site and are accessible. Probably need to allow an entry in web.xml to configure where/what this directory is called.
    2 - jar file only:
    Provide a servlet to access the images, which will load them from the jar file, using the ClassLoader.getResourceAsStream(). Requires declaration of a servlet in the web.xml file. Won't be as efficient as having the images on disk, but will keep them bundled in the jar file.
    you would generate code such as <img src="myImgServlet?img=.....">
    Cheers,
    evnafets

  • Where to put images in web Dynpro project to have them deployed?

    Hi Brothers,
    I would like to show an image in an <img>-tag within a Formatted Text View UI Element.
    I have created a folder img under src/.../projectname and I have referenced the image in the <img>-tag as follows:
    < img src="/LocalDevelopment~LocalDevelopment~testroadmap~demo.sap.com/src/packages/com/sap/demo/projectname/img/newRow.JPG"; /.>
    However, the image is not shown in the Formatted Text View UI Element.
    Does anybody know where to put images so that they are packed in the .war achieve and deployed and how to referenced them?
    Thanks, Johannes

    Hi,
    place the image in the following folder of application,
    src\mimes\Components\<your component name>.testroadmap.demo.sap.com
    If you store the image file in your Web Dynpro project under src /mimes /Components /<Name of Component>, you only have to specify the file name without a path.
    Regards,
    ramesh
    Edited by: Ramesh Babu V on Sep 19, 2008 1:58 PM

  • Where to store data (queued message handler)

    Hello,
    i'm developing an image processing application. As a template i'm using the 'queued message handler'. In my app I need to store some images, arrays, and so on in RAM. Now the question is  if i should store that data in the message loop's shift register (in a cluster) or somewhere else.
    At the moment i have hidden front panel indicators where i store all my data. This isn't good practise, is it?
    thanks alot
    MN

    nollMarvin wrote:
    Hello,
    i'm developing an image processing application. As a template i'm using the 'queued message handler'. In my app I need to store some images, arrays, and so on in RAM. Now the question is  if i should store that data in the message loop's shift register (in a cluster) or somewhere else.
    At the moment i have hidden front panel indicators where i store all my data. This isn't good practise, is it?
    thanks alot
    MN
    No that is not good practice.
    A Shift register is a much better place to store data in memory it does that without creating copies the OS must interperate for display.  (Yeah the displaying of data to a user is a different concept than having data in memory) Ben's famous Action Engine Nugget is always a good read. http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801
    And a basic concept to LabVIEW that attending a training session (or asking questions on these forums) will help you master
    Jeff

  • I need help to store images in database

    hi,
    at present i am working in oracle, i need one help.
    i want to create one directory in c:\drive and i have to store and retreive my images in that directory.i want to do in oracle only,i am not using any front end. i need coding for that,please give me coding to do that.first i have to store that images in my table.that image is in my desktop,how to call that image and how to store that image in my table and how to store that image in that directory. please give coding and ideas for that,help meeeeeeeeeeeeee.

    You need to create a oracle directory which will point to the physical directory where picture or image file lies...
    For this you need create directory privillege
    Once you create the oracle directory..
    Please see my sample try
    create table sample_bfile(id number,photo bfile);
    insert into sample_bfile values (1,bfilename('<oracle_dir_name>','<file_name>');
    This will insert into the reference of the image in the column...
    But you cant select this column in sqlplus which u might be knowing...
    Then you can access the image with the front end
    Regards,
    Shasi

  • Where are the images stored after migration

    I'm totally lost after migrating my pictures from iPhotos.app to Photos.app...
    From an article from Apple, (see below) there is no duplication of the library even if it looks like (when you look at the GB). So i understand that there is a kind of link or alias for each picture. But i would like to know where the original ones are (imposible to know looking at the finder because both libraries show strangely a lot of GB.
    So I tried different options to understand. If I delete an event in the iPhoto library and definitely trash it, these pictures are still in Photos. And if I delete some pictures in Photos.app definitely (deleting definitely from File Menu > Show Recently Deleted) these pictures are still in iPhoto !!! So where are the real pictures ??? In which library? Somewhere else? Why the two libraries are showing all these Gb and it does'n't correspond to the capacity storage of my hard disk...
    I really don't understand how it works... Any help would be very appreciated.
    Article from Apple :
    Photos saves disk space by sharing images with your iPhoto or Aperture libraries
    Learn how Photos stores images when you migrate your iPhoto or Aperture library and saves disk space by sharing images.
    When you migrate a photo library from iPhoto or Aperture, the Photos app creates a new library structure but doesn't duplicate your images. Instead, Photos saves disk space by creating links to the original and preview versions of your images.When Finder reports the file size of your Photos library, it includes all your originals and previews. It may look like your remaining iPhoto or Aperture library is taking up twice the space on your hard drive, but it isn't—your images exist only in one location, even though you may have more than one photo library.After you migrate your iPhoto or Aperture library to Photos, you might feel tempted to delete your original iPhoto or Aperture library. Because the migrated library takes little additional space, you don't need to delete the original library.

    They're in both libraries; a hard link to a file is indistinguishable from the original file, and either one can be deleted without affecting the other.
    (126387)

  • Store images problem 6610i

    I have Nokia pc Suite installed, phone 6610i is connected by cable, when I click store images I get a window that says Image store has encountered a problem and needs to close, with the possibility to debug, send an error report or don't send, aal of wich do not help. After that the Nokia windows disappear. That never happened at the earlier version of pc suite. Please some one help, Alex.

    I never found a solution with that specific pc suite s/w and phone s/w.
    I just kept upgrading my phone and pc suite and now it works.
    Sorry this isn't much of help.
    Peace,
    Mo

  • I have a file where I store my download music. When I click on "add music" to my ipod my music file opens, but rather than have to drag one song at a time to my ipod, how do I copy the entire file at once to my ipod. - steve

    Hi - I have a file where I store my downloaded music. When I plug in my ipod and click on "add music" my file appears. Rather than drag one song at a time, how can I download the entire list at once? - steve

    I am not doing it in ITunes, but i did down load the song from ITunes.  I loaded the song on to my Nano, but in my menu selections it doesn't show the song or the artist in any search format.  However, when i plug in my nano to my PC I see the Nano library on my PC drive listings and that song and artist are there.  I can click on the song and it will play in Windows media on my work PC.  I did notice that the format for most all the songs in my library on my Nano are MPEG - 4 audio Files. 
    Thanks for your help, Mel

  • Where we store in sap r/3

    Dear sir  we can uploaded old data in sap r/3. by lsmw and bdc. but where we store.
    thanks regards
    jitendra

    Hi,
    LSMW - Helps to transfer data from legacy system to SAP either one time or periodically.
    Steps -
    1. Import data (legacy data in spreadsheet tables and/or sequential files)
    2. Convert data (from source format to target format)
    3. Import data (into the database of the SAP application)
    a. Maintain Structure relations, field mapping and conversion rules.
    b. Data from legacy system is read
    c. Based on step a, the data gets converted
    d. The converted data is imported to R/3 system based onBatch input processing or Direct Input or through IDOC Inbound processing
    Regards,
    R.Brahmankar

  • I am getting an error message with my snap scan ix500 that says the Evernote is not installed properly.  I have uninstalled/reinstalled evernote but it still doesn't work.  Anyone know where evernote stores their files on a Mac/

    I am getting an error message with my snap scan ix500 that says the Evernote is not installed properly when I try to transfer it.  I have uninstalled/reinstalled evernote and the scan snap softward but it still doesn't work.  Anyone know where evernote stores their files on a Mac?  Or had this problem.

    Are there any dialog boxes popping up behind your Yahoo screen?
    I have intermittent problems attaching files in Yahoo mail and this is usually the reason.  I'm also using an iMac (10.7.3) and this is likely the problem.
    It is generally a Yahoo issue rather than a Mac problem.

  • How to store image in the oracle database 10.2. using File Maker 10.

    Hi.,
    I want to store image, media file in the oracle database using File Maker as a front end.
    I connect Oracle using odbc from file maker. There are table and in that table there a column "pict" of blob type. but this column is not showing in the file maker.
    2. Here I can not change the data type of any column.
    Now how to store images in the oracle table using odbc or any other tool.
    Regards,
    Shyam

    I wrote an example for my students, you can find it here. It's using PHP as the front end but all you need to do is know how and leverage the stored procedures. All code is downloadable in zip files from the blog.
    http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

Maybe you are looking for

  • Create custom code colouring for additional file types

    Hi All, I spend a lot of time editing .ini files in Dreamweaver (in my case langague files for custom Joomla extensions). Although the file format is extremely  simple, particularly in the way that they re used in this context, I would like to improv

  • JSF pages too large to compile

    I have a page that contains a large number of textbox controls and message components. When I try to run the page on my test server I get a compile error that the code is too large within a try statement. Is there any server settings that you can cha

  • MacBook and Wireless Epson Printer won't connect anymore?

    I have a MacBook Pro running Lion OSX. I also have an Epson Stylus NX430. I had it connected to my laptop wirelessly and it worked fine. I went home for spring break and when I came back, I tried printing something, and my computer said that my print

  • Asynchronous simultaneous processing from EJB

    Hi all, Imagine you needed to do some bulky task (say processing of a very big XML doc). The thing takes say 15 min, and you find that unacceptable. In a normal standalone app, I would split that XML in smaller chunks, and kick off a few threads to p

  • Time Mashine - Back Up

    If I have special memories on my fixed disk, but not on my MacBook, will these memories automaticly be imported, by Time Machine back up, to my MacBook? Sorry, for my bad English and thank you!