Results 1 to 4 of 4
  1. #1
    ashton is offline Member
    Join Date
    Jan 2009
    Posts
    31
    Rep Power
    0

    Default a little help with file paths

    hello guyz!!

    uhmm.. I am currently working on a project that asks for a user's name and the user's photo will pop-up at the corner.. (just to give you an idea)

    My new problem is, I know how to import image files into the project but, is there a way to save external image files (new images to be saved)??

    uhh.. ok...
    What i would like to do is save a user's name, age, etc... but of course, also a new photo of the user... It came to my mind: "what if I use file paths??" coz I searched for tutorials on how to upload images and having a file path is one of them... The problem is, can someone please further explain how to manage file paths,. i mean, how to use file paths for saving external images that a user wants to upload into the program..??

    a small example would be of great help.. :confused:

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    do you mean upload or import? there's a big difference. i've seen your old posts where you mixed the two terms.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    ashton is offline Member
    Join Date
    Jan 2009
    Posts
    31
    Rep Power
    0

    Default

    Sorry.. what's the correct term for displaying images within a program but the image's file is located in an external folder or something like that?? (I'm still not used to these terms, sorry.. harhar:p)

    I just want to display images in my program but from outside of the program itself..

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Where are you storing the rest of the user information? If you are using a database, the best place to store the image is there.

    Rather than using a blob, I suggest using a varbinary field with a length around 1,000 bytes in a detail file. Using "var", the last record will just be shorter, no junk on the end. Just write the image out in chunks, and read them back the same way. That's generally more efficient that blob. Once you read the image back, if you are using a Web app, you can create a file in an appropriate directory and create an image tag.

    If you are using a Swing application, look at JFileChooser. If this is a Web app, HTML has a means of displaying a directory list and uploading a file's data.

    The big thing with images is to remember they are just a bunch of bytes. Don't manipulate them! Keep the file name and extension, which will allow outside applications to determine the MIME type.

Similar Threads

  1. [SOLVED] Getting directory paths
    By Leprechaun in forum New To Java
    Replies: 8
    Last Post: 04-23-2008, 06:30 AM
  2. getting paths and directories
    By marco in forum Java Applets
    Replies: 3
    Last Post: 11-25-2007, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •