Results 1 to 3 of 3
  1. #1
    kissiffer4 is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default Need help - Create an application to loop through folder of images & insert to db

    Hi,

    We have a requirement to loop through a folder of images (around 1000) and insert all of them to a database. Is there an 'easy' way I can do this using SWT/JFace? Ideally, the user would be able to select all of the images they would like to upload.

    Any feedback much appreciated.

    Thanks,

    Christopher

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    So you need to insert 1000 images into the database or only the ones the user selects? If your just uploading them to the database don't work with the actual image, just use the file name and insert them that way. If it's the sort of thing where all images on an SD card are shown and the user selects which one to upload then your most likely going to want to use a Composite with either a bunch of say 200X200 Canvas objects to display the images or just set a large Canvas on top of the composite and resize the images and place them.(I havn't worked with canvas so I don't know if it allows multiple images on a single 1 which is why there are 2 options). Personally even if Canvas does allow you to attach them all to one I think it may be easier if each image has its own canvas and you just set like 5 to a line or something in your composite

  3. #3
    kissiffer4 is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by xcallmejudasx View Post
    So you need to insert 1000 images into the database or only the ones the user selects? If your just uploading them to the database don't work with the actual image, just use the file name and insert them that way. If it's the sort of thing where all images on an SD card are shown and the user selects which one to upload then your most likely going to want to use a Composite with either a bunch of say 200X200 Canvas objects to display the images or just set a large Canvas on top of the composite and resize the images and place them.(I havn't worked with canvas so I don't know if it allows multiple images on a single 1 which is why there are 2 options). Personally even if Canvas does allow you to attach them all to one I think it may be easier if each image has its own canvas and you just set like 5 to a line or something in your composite
    Thanks for your input. At this point, just uploading the entire bunch from the folder would suffice.

    Would it be possible to allow the user to enter the path or select the directory that contains the images? Also, by using the file name, I am assuming I would still need to use the same InputStream code, but just loop through all of the files, correct?

    Thanks again. Not looking for code..just for some guidance :)

Similar Threads

  1. code to create a folder in java
    By radhika123 in forum New To Java
    Replies: 7
    Last Post: 07-21-2011, 11:21 AM
  2. How to create Folder View
    By jazz2k8 in forum Advanced Java
    Replies: 2
    Last Post: 10-24-2008, 02:04 PM
  3. How to create folder(s) and store data?
    By Grom in forum New To Java
    Replies: 2
    Last Post: 08-20-2008, 09:01 AM
  4. Replies: 0
    Last Post: 08-14-2008, 01:07 PM
  5. How do I create an Array of Images
    By wco5002 in forum New To Java
    Replies: 3
    Last Post: 03-21-2008, 03:45 PM

Posting Permissions

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