Best way to upload and store image file using struts

Hello there,
I'm having two choices for uploading image files(not huge image files) using struts a) to store the image in application server's directory
b) to store the image files as BLOB in database.
Although each of the image files have to be associated with unique ID to identify the image for re-display.
Which is the best option. application server's directory or database
josh

I think storing it in the application server directory would probably allow for faster access, is easier to code, and doesn't depend on db connectivity.
As for the unique id, you could probably use the File.createTemporaryFile method--it returns a unique id for every file in a directory, given a prefix & suffix. You just have to remember to change the extension from a .tmp to the image format you're using.
Anyway, that's my 2 cents.

Similar Messages

  • What Is the best way to upload and download psd files from Photoshop to Photoshop Touch? [was:Re]

    What Is the best way to up load and down load psd files from desktop photo shop to photo shop touch? For on the go touch up or. I'm using psd files at 90 percent 300 depi when in photo shop on desktop. To ps touch

    Hi Bford225,
    I'd recommend using your favorite web browser and going to https://creative.adobe.com/files for uploading from the computer.
    Keep in mind tablet capabilities are much less than a computer, so large files might take a long time to download and be very system intensive to work on. Although you can import files up to 12 megapixels I'd recommend something more mid range, like 6 or 7 megapixels, ie 2880 x 2160 or 3072 x 2304.
    Also, PSD files are flattened when imported into Photoshop Touch.
    Hope that helps,
    -Dave 

  • What is the best way to archive and store old mail using Apple Mail?

    Hi,
    I have a number of older emails that I would like to archive and store for potential future access. Even though I have mails from earlier Lotus Notes accounts and Microsoft Office accounts, I am referring in this case only to apple mail data that I ave 'stored on my mac'.
    Any advice would be great. At the moment I am using predominantly gmail, so if things go haywire, rebuilding my mail is relatively easy. That said, I tend to file and save locally important messages.
    Cheers,
    Mark.

    This is from Mail's help:
    Archive messages
    You can store messages in an Archive mailbox so that you can quickly find them later when you’re ready to take action.
    Select one or more messages to archive.If you select a conversation, all messages in the conversation are archived.
    Choose Message > Archive.An Archive mailbox is created for each account whose messages you archive. For example, if you archive a message sent to your iCloud account and a message sent to your Yahoo! account, an Archive mailbox is created for each account.Archived messages remain in the Archive mailbox until you delete or move them. Depending on the account type, the Archive mailbox is stored on the mail server.
    You can customize the Mail toolbar to include the Archive icon.

  • Best way to view and edit OpenOffice files on my new iPad Mini (originally Word and Excel files). Thanks!

    Can someone tell me the best way to view and edit OpenOffice files on my new iPad Mini (originally Word and Excel files)? Thanks!

    wmf files is a MS Windows video file, you will need a tool to covert the wmf files to another file format OS X will read. Simply Google to find a converter you are interested in and use it.

  • Best way to save and view raw files while traveling.  I have dropbox but new ipad user and not sure of best way.

    What is the best way to save photos when shooting RAW while traveling.  Would like to save raw files but also view and email from iPad.  I also have dropbox.  Will be in Europe next spring.

    Unfortunately, the playback of non-iOS-native video formats (everything except mov / mp4 / m4v) is horrible through Apple TV and it, because of the inherent speed restrictions of Wi-Fi, can't be helped other than:
    - pre-converting your video files to mov / mp4 / m4v before playing them. (THis is the best solution.) For this, you will want to use the absolutely best and fastest video converter, the free(!!!) HandBrake. Don't ever think of paying any money for any video converter - most other titles are way inferior to HandBrake. (See http://www.iphonelife.com/blog/87/benchmark-excellent-multimedia-converter-handb rake-vs-commercial-apps for more info on this q.)
    - using a VGA or HDMI adapter and connecting your TV directly to the iPad.
    In the thread at https://discussions.apple.com/message/18697551?ac_cid=sa123456#18697551 , we've also discussed this problem (AirPlay vs. cabled playback)

  • Best way to view and edit wmf files

    How can I view and edit wmv files on my iMac?

    wmf files is a MS Windows video file, you will need a tool to covert the wmf files to another file format OS X will read. Simply Google to find a converter you are interested in and use it.

  • Can u please send me a sample code to upload and download a file using java

    Hi,
    Please can u send me a sample code to upload a file and to download the same file from a remote server using a java servlets. The file should be read byte by byte.
    Message was edited by:
    user461713

    Hi, Thank u.
    Sorry, I forgot to attach a code. Here it is.
    Actually i need to upload a file to a remote server and download it from a server to my machine. I'm trying it using servlets and using tomcat5.0 as a servlet container. Here i'm sening a code used to upload a file. Let me know whether it works. Only few lines are here.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.lang.Object;
    import java.util.*;
    import java.lang.String;
    import com.oreilly.servlet.MultipartRequest;
    public class FileUpload extends HttpServlet{
         public void doPost(HttpServletRequest req, HttpServletResponse res)throws
         ServletException, IOException{
         MultipartRequest multi=new MultipartRequest(req);     
         String file="file1";
         byte[] b=file.getBytes();
         InputStream in=null;
         BufferedInputStream bis=null;
         FileWriter fw=null;
    try{
         in=multi.getInputStream("file1");
    bis=new BufferedInputStream(in);
         File output=new File("/fileuploadtest");
         fw=new FileWriter(output);
              int i;
              i=bis.read();
              while (i != -1) {
    fw.write(i);
    i = bis.read();
         catch(IOException e){
              System.out.println("Exception=" +e);
    finally{
         try{
              if(in!=null)
              in.close();
              if(bis!=null)               
              bis.close();
              if(fw!=null)
              fw.close();
         catch(Exception e){
              System.out.println(e);
    This code is giving error as: cannot resolve symbol: class MultipartRequest
    Why is this happening?
    Pls let me know whether this code works or no and also i have written form.html.
    Can u pls tel me whether there are ways in which i can write a code to upload a file using servlets without using third party packages. Pls help.
    Also how should be the servlet mapping for this code.?
    Regards
    Message was edited by:
    user461713

  • Best  way  to  record  and  store  recorded  radio  programmes

    Hi-I have just aquired 66 and a half hours of the late great UK DJ John Peel radio show.They are all on video with just the sound.I would like to record them into the mac and then transfer this onto CD or DVD if I can.I have Sound Studio installed and have managed to record some Lp's and transfer them onto CD.So maybe i could use that-although i saw in a magazine recently that you can use Garage Band to record stuff on (although i have not bought the magazine yet).My geuss is that i would have to record them into/as MP3-which would mean i could get more onto CD or DVD.Does anyone have any pointers about the easiest way i could do this and if i would get 66 and a half hours onto one CD or DVD ? As I have never attempted to do this before. (or how many Cd's or DVD's it would take to store 66 and a half hours ?).Any tips please would be much appreciated
    thanks
    rick
    ps- i have been told that the recordings are of high quality mostly-so any pointers about the quality of recording i would need to make it do it in for the quality to remain high ?
    pss-i do not yet have a device to connect my video recorder to the computer-but my geuss is i would be able to connect it via the sound output plugs-if their are any on the video recorder ?

    I think storing it in the application server directory would probably allow for faster access, is easier to code, and doesn't depend on db connectivity.
    As for the unique id, you could probably use the File.createTemporaryFile method--it returns a unique id for every file in a directory, given a prefix & suffix. You just have to remember to change the extension from a .tmp to the image format you're using.
    Anyway, that's my 2 cents.

  • How do I upload/download a txt file using struts

    what do I need on my JSP page and how do I implement this functionality in an action?

    both work differently
    upload: <html:file tag (i thin) with a FormFile property in your ActionForm
    download use a servlet that uses the outputstream from hte response to send the file

  • Upload and display image in webside

    Hello Friends,
    I am developing an auction web site ,and facing some problem so I need your help.
    There is some confusion about uploading and displaying images in website .In web based
    application if I want to upload images than where have to store the images database or server
    side any folder .I have not idea about that please send your ideas and sussesions.
    Second problem is What is the best way to display images in webside either giving a direct
    path of server side image folder or I need to retrieve all images from database .
    I have no idea about it please send me your guideline which are usefull for me to implement in my
    website.
    what is the correct way to upload and display images in website ?
    Thanks . Have a nice day.

    If you are using a Container you just leave your image files in the home directory of your web application. And forget this idea about database. It´s not necessary in this case.
    To display the images just use HTML, <img src="url">.

  • How to upload and store pic in database through Servlet

    Hi
    I am new to servlet programming. I need some help i am developing shopping cart of pictures
    I have problem in admin module
    When admin upload new picture and description of picture
    i want to store information of uploaded picture in database so that user can view new photographs for shopping
    Now problem is that how to upload and store picture in database and how to retrive picture from datebase and disply on user end
    I am in great difficulty
    I need some sample code
    Can some one help me
    I shall be very thankful

    Use BLOBS to upload and download image files into the database....
    Here is a sample code for doing it from one of my earlier posts....
    http://forum.java.sun.com/thread.jsp?forum=31&thread=143837
    Once you get the file from the database, use the image tag in HTML to display your picture....
    Let me know if you have any further questions....

  • How is the best way to backup and organize Adobe layered .PSD files on iMac OSX maverick?

    How is the best way to organize and backup Adobe layered PSD files on iMac desktop OSX maverick?
    I lost all my Adobe Photoshop files + everything else on my IMAC when it crashed. They reinstalled Operating System.  But now i must install programs such as MS Word & Adobe indesign suite.
    Please help me determine what is the bestway to backup Adobe layered  PSD files? I believe these are my choices to be assured this doesn't ever hapen again. Please comment.
    Buy Apple Airport Time capsule $280.  But I am not sure if it can store PSD layers. Can it or do you have to have Apple Apperture  software to act be sure layers are saved
    I had had trouble getting Adobe Cloud to sync to save files and so just trusted my computer to not ever crash.  Any hints on this procedure
    Are there any hints on PhotoShop image organization for a current IMac usser ?
    Please help.
    Teann  ucreateit

    My backup plan is to use Time Machine to make a backup to an external disk drive plus I also do a clone of my system disk. So far between the bootable clone and the Time Machine backup this plan has covered all of my needs.
    Allan

  • What is the best way to upload icons I created on illustrator, onto a photoshop file of a website design?

    I currently in the process of designing a website on Photoshop. I have designed some icons for the website using Illustrator. What is the best way to upload these icons onto the photoshop file and keep them looking crisp and high quality? I have tried a number of ways but all seem to come out pixilated.

    What you need to do is make sure you are creating the Illustrator icons at the same ppi as the Photoshop document and at the correct size. If you have created the icons say with 300ppi but are in pixels it won't carry the same properties as the website you are creating if that has been set up as 72ppi and therefore will distort.
    Once you have mastered that then you are best (if you think there may be changes to the icons later down the line) to create .ai files of each icon and place them intt the Photoshop document, then if you make any changes to the source .ai file it will update within you website design.
    If you don't see the icons changing then you can always just copy and paste directly from Illustrator to Photoshop and make any changes on the fly by making sure you keep it as a smart object.

  • Best way to upload a large 25 minute video and where to?

    best way to upload a large 25 minute video and where to?

    Just a couple minutes surfing - YouTube only allows 15 minute videos from general users -- to upload larger apparently you have to be a trusted long time source.   There is also a restriction on the file size.
    YouTubes help section should give you all the details.
    I don't watch online videos - so I just used a query in ASK.Com to get some quick tips.

  • HT1198 I shared disk space and my iPhoto library as described in this article. When creating the disk image, I thought I had set aside enough space to allow for growth (50G). I'm running out of space. What's the best way to increase the disk image size?

    I shared disk space and my iPhoto library as described in this article. When creating the disk image, I thought I had set aside enough space to allow for growth (50G). I'm running out of space. What's the best way to increase the disk image size?

    Done. Thank you, Allan.
    The sparse image article you sent a link to needs a little updating (or there's some variability in prompts (no password was required) with my OS and/or Disk Utility version), but it worked.
    Phew! It would have been much more time consuming to use Time Machine to recover all my photos after repartitioning the drive. 

Maybe you are looking for