4 Replies Latest reply on Oct 15, 2007 4:18 AM by Günter Schenk

    Setting Max Files Upload

      I'm trying to limit the number of images a user can upload with the ADDT's Multiple Image Upload. What would be great is setting it to 10 for some users and 50 for other users. Any ideas? There is already a error message when a user reaches the max amount of files 'FLASH_MAX_FILES_REACHED' => 'Skipping file %s. You cannot upload more than %s files.', But I can find how to set it.
        • 1. Re: Setting Max Files Upload
          Level 1
          Find this on the page with the uploader:

          // Multiple Upload Helper Object
          $muploadHelper = new tNG_MuploadHelper("../../", 32);
          $muploadHelper->setMaxSize(7000);
          $muploadHelper->setMaxNumber(10); <---That sets the max number
          $muploadHelper->setExistentNumber(0);
          $muploadHelper->setAllowedExtensions("jpg, jpeg, gif");
          • 2. Re: Setting Max Files Upload
            Günter Schenk Level 4
            Hi Louis,

            >>
            $muploadHelper->setMaxNumber(10); <---That sets the max number
            >>

            you could in fact replace this currently "hard coded" value with e.g. an URL parameter defined in the page (a List probably) which links to this one -- I´m using this approach quite often, and the main preparatory steps would be:

            1. add a numeric "max_file_upload" column to your user table

            2. add another query to your list which will determine this value for the currently logged in user, example:

            "SELECT max_file_upload FROM user_table WHERE user_id" matches ADDT´s session variable "kt_login_id"

            3. add the "dynamic text" instance related to this query to the link that´s pointing to your image uploader page -- means, an URL parameter like e.g. img_uploader.php?max_uploads=

            4. in order to use this dynamic value instead of the default one, please replace...

            $muploadHelper->setMaxNumber(10);

            with...

            $muploadHelper->setMaxNumber($_GET['max_uploads']);

            Normally this should do it, as I did similar "on the fly" replacements within several ADDT triggers like this. However, when doing so, please note that this trigger *might* temporarily not be editable from the Server Behaviour panel -- but when reverting to the default hard coded value, it should all work again.

            Please let me know how it works ;-)

            Cheers,
            Günter Schenk
            Adobe Community Expert, Dreamweaver
            • 3. Re: Setting Max Files Upload
              I need help to INSERT FILE SIZE IN DATA BASE (MYSQL).
              • 4. Re: Setting Max Files Upload
                Günter Schenk Level 4
                Hi,

                ------
                I need help to INSERT FILE SIZE IN DATA BASE (MYSQL).
                ------

                why this ? For display purposes ? If so, server side scripting languages such as PHP provide features to help you grab & format & show the file size of e.g. an image on the page that´s displaying the image.

                Cheers,
                Günter Schenk
                Adobe Community Expert, Dreamweaver.

                P.S. Please consider to rather start a new thread, when your topic is (like this one) not related to an existing one