4 Replies Latest reply on Sep 9, 2007 11:00 AM by (Jose_Espinal)

    Image Uploader copy file

    Level 1
      Hi,

      I am using the Multiple Image Uploader, and I want this to happen when a person first comes to upload an image: Copy a single file into that corresponding image folder.

      Sounds easy, but I've come around with the questions of how make the file only copy once the user creates the "subfolder" and how to copy() the file to that specific folder.
        • 1. Re: Image Uploader copy file
          Günter Schenk Level 4
          Hola Jose,

          I hope I understand your strategy correctly - if not, please let me know :-)

          Well, first I wonder why you´re implementing a "multiple image uploader" when you want the upload to be restricted to one image only ? I know you can limit the number of uploaded files to 1, but just providing ADDT´s single-file "Upload and resize images" behaviour to the user would probably make more sense -- and it´s IMHO far less confusing to use, because it uses just one regular file field.

          However, I personally would do it this way:

          1. let the user upload the image into a folder that´s named according "to his "kt_login_id" variable - do you do that already this way ? BTW, the specified subfolder will, on upload, be created in case it doesn´t yet exist.

          2. however, as the "Upload and resize images" behaviour will have to attached to an "Insert Record" or "Update Record" transaction anyway, you can go and create an "update" transaction which will store the uploaded image name in a separate "varchar" column of your "users" table -- let´s call that new column "user_image" for now.

          3. once a user has uploaded an image whose name has been stored in the "user_image" column, you can prevent this very user form uploading further images by...

          a) creating the following query on the "upload image" page:

          "SELECT user_image FROM user_table WHERE user_id" equals the session variable "kt_login_id"

          b) add a "Show If Conditional Region" to this page which will display the image upload form only if the query´s "user_image" column equals (==) NULL, means if this column is currently empty (simply leave the field "Expression 2" empty) -- and use the "has Else" option to otherwise hide the form & display a "you did already upload an image !" note instead.

          It´s that what you mean ?

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Image Uploader copy file
            Level 1
            Hey Gunter, thanks for the quick response. I'm sorry I didn't describe the problem completely. Actually I'm using multiple image uploader because what I'm trying to upload is multiple images for a certain listing on a real state site.

            So, what happens is with Img uploader, It'll throw a set of images to a folder with the same listing id and I have a little PHP script I want to be able to copy inside each folder that creates with the new listing and then it will generate a little gallery of all the images inside that folder.

            Thanks in advance.
            Jose :D
            • 3. Re: Image Uploader copy file
              Günter Schenk Level 4
              Hi Jose,

              wow, that´s now something *completely" different :-)

              I´m actually very familiar with your scenario, as I do real estate stuff as well where external contributors upload images, and I´m also adding "slide show" files once the very first image has been uploaded - so here´s how I do it:

              1. make ADDT send yourself an email notification after the user did upload the first set of pics related to property ID X

              2. for uploading your related slide show file, create yourself a separate "file upload" page that´s only accessible to you (e.g. check against the usual "admin" level 1)

              Personally I prefer to implement such extra forms as "popup window" rather than using the default "next page" approach -- actually for just one reason: this way I can just show/hide the *link* to the popup window based on e.g. the current user level.

              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Image Uploader copy file
                Level 1
                Hey Gunther, thanks a lot for the help :D!

                Jose