We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    seems you are not having an extra-table for your images like lithiumlab, but you are storing your images into one field in your table?

    than the process is a bit different.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 17249 ☆ A M B ☆
      • 165 Posts
      Maybe boomerang used migx instead of MIGXdb for the tv handling the multifile upload?
        • 17249 ☆ A M B ☆
        • 165 Posts
        Hi Bruno;
        I can confirm this is working in my environment.
        Data is being persisted correctly as instances of ContentPhoto Object in the DB.
        The grid is being updated with the new items correctly related.

        There's some issues:

        • thumbnails are not being generated
        • only 'thumbs' folder is created, not the other ones in resizeConfig mediasource property
        • filenames are being changed somehow (in my case IMG_001.jpg changed to img-001.jpg)
        • Even the files are uploaded in the correct folder the iframe window marks the uploaded files as Failed, maybe because thumbs are not being generated.

        If i switch to my previous imageupload.php inside my project the different thumbs and folders are generated correctly from resizeConfig data in mediasource.
        I've made a DIFF between the two files but can't find the problem yet.
        http://diffchecker.com/k3qdnj7o


        UPDATE: See screenshot for clarification. [ed. note: lithiumlab last edited this post 13 years, 3 months ago.]
          • 17249 ☆ A M B ☆
          • 165 Posts
          Just commented
                              $uniqueName = $resource->cleanAlias($uniqueName);
          


          And everything is good to go.
          Again, thanks a lot Bruno for all your help putting this out.
            • 3866 ☆ A M B ☆
            • 350 Posts
            Quote from: Bruno17 at Jun 27, 2013, 09:32 AM
            seems you are not having an extra-table for your images like lithiumlab, but you are storing your images into one field in your table?

            than the process is a bit different.

            Hi Bruno, you're right I've implemented in a different way. I don't have an extra table for images, I simply want a way of storing the data in a field in one of my tables.

            The data is being stored as follows:

            [{"MIGX_id":"1","image":"icon-4.png","deleted":"0"}]


            I now need to extract it.
              Helen Warner
              Number one pixel!
              Proud to be linked with MODX at Crimson Pixel
              • 3866 ☆ A M B ☆
              • 350 Posts
              Quote from: lithiumlab at Jun 27, 2013, 09:41 AM
              Maybe boomerang used migx instead of MIGXdb for the tv handling the multifile upload?

              I have used MIGX for multifile upload - should this be MIGXdb even though I'm not storing it to a specific table?

              Thanks guys for all your input, I think this could be a really exciting addition. And I'm more than happy to put together a step by step guide when we've got it working.
                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel
                • 4172
                • 5,888 Posts
                MIGX is the right inputTVtype, if you want to store the images into one field.
                Will check this option and how it goes later, too

                For getting the images you use the getImageList-snippet inside a migxLoopCollection, rowboat or bloX-tpl this way:

                [[!getImageList? &value=`[[+images]]` &tpl=`yourImageTpl` &rowid=`[[+id]]`]]


                in yourImageTpl you can then get the path to your image with:

                assets/yourfolder/[[+property.rowid]]/[[+image]]


                [edit] changed property.id to property.rowid
                [ed. note: Bruno17 last edited this post 13 years, 3 months ago.]
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 3866 ☆ A M B ☆
                  • 350 Posts
                  Quote from: Bruno17 at Jun 28, 2013, 01:45 AM


                  For getting the images you use the getImageList-snippet inside a migxLoopCollection, rowboat or bloX-tpl this way:

                  [[!getImageList? &value=`[[+images]]` &tpl=`yourImageTpl` &rowid=`[[+id]]`]]


                  in yourImageTpl you can then get the path to your image with:

                  assets/yourfolder/[[+property.rowid]]/[[+image]]


                  Thanks Bruno, that has worked and I can access the images from the database field.

                  However, (there's always one of them) there are still a couple of issues.

                  Firstly when creating a brand new entry for my database before an ID has been assigned to the row, if you try to upload images the folder name that is created is named 'new' rather than the id of the entry. Is it that a new entry has to be created before images can be uploaded, which I'm assuming it is - how could I get the Images tab to appear after an entry has been made and saved?

                  Secondly, I'm occasionally getting a failed message during the upload process although the images are actually uploaded.

                  And thirdly, if I try to upload images into more than one id row, it seems only the first id is remembered and all the images end up in that folder - is this a caching problem?

                  Otherwise I think this is looking really good. Thank you for all your input - have you got that "Donate to Bruno" button going somewhere too?
                    Helen Warner
                    Number one pixel!
                    Proud to be linked with MODX at Crimson Pixel
                    • 3866 ☆ A M B ☆
                    • 350 Posts
                    I still seem to be having problems when creating more than one entry to my database in that when uploading images if I've created an entry at id 365 and then immediately create id 366, any images that get uploaded end up in the folder 365 - until I refresh the page or clear the cache.

                    I think I can work round having to create an entry prior to adding images, but not being able to add more than one entry at a time before clearing the cache may prove a bit frustrating for the client.

                    Any other suggestions?

                    I have put a tut together regarding the set up I'm using, but can't really publish it until this is resolved. (I've sent a copy to Bruno for info).

                    Thanks
                      Helen Warner
                      Number one pixel!
                      Proud to be linked with MODX at Crimson Pixel
                      • 3866 ☆ A M B ☆
                      • 350 Posts
                      Hi there, still seem to be getting errors when trying to upload images into more than one data row if doing one after the other. The following error has appeared in the error log - several times

                      [2013-07-17 02:18:56] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /paas/c0000/www/core/cache/phpthumb/phpThumb_cache_mysite.modxcloud.com_src4d4abfee0e241d9af8bbf9c2cb30ef7e_parfe75230c38c1dd77cfb659e43ae25583_dat0.jpeg
                      [2013-07-17 02:18:56] (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
                      OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557


                      The only way to ensure this doesn't happen is to clear the cache in between each entry, but this isn't ideal for a client to maintain. Any suggestions?
                        Helen Warner
                        Number one pixel!
                        Proud to be linked with MODX at Crimson Pixel