We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8790
    • 526 Posts
    Hi,

    Can you explain how this issue was solved ?

    Thank you
      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
      • 87
      • 51 Posts
      anyway to allow the uploader to create and specify a new folder within the path they are uploading to?
        • 19726
        • 239 Posts
        This is not possible with the current snippet. But you could add some additional fields to the form and add a bit of code to create the paths on upload.
          • 87
          • 51 Posts
          I tried calling a TV within the call inside my template but it is saying the path is invalid.

          [!FileUpload? &tpl=`fileuploadformmultiple` &path=`/assets/images/events/[*folder*]/` $createpath = `1` &uploadgroups=`event admin`&extensions=`jpg,png`!]

          I know the folder tv is giving me a result since I have a few other calls to it, and those do work.
          I am using FDM with a few tv’s, which creates the page, on the page I have the fileupload snippet since I couldn’t get it figured out how to use it along with FDM. Inside the form a field specifies what folder to upload and pull images from. I don’t have the technical know how to do this any better. Unless anyone has any other ideas.
            • 6726
            • 7,075 Posts
            It’s funny I never came accross this question but here it is : I use FileDownload snippet/plugin combo as a basic file browser, but I have added an upload form with the FileUpload snippet.

            As you know, FileUpload needs a path to upload the files to. What I’d like to do is use the [+fd.path+] value as the &path parameter for FileUpload, so that when the user browses the folders the file is uploaded in the currently browsed folder.

            Of course I can’t use a placeholder from FileDowload in a FileUpload chunk tongue
            I have given a look at filedownload.class.inc.php and the part where placeholder are set (around line 190), but as usual I can’t make head or tails and solve it myself... anyone has already done that ? or an idea ?

            Thanks !

            Edit : Nevermind, it would seem FancyUpload does just that !
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 87
              • 51 Posts
              Quote from: Mitch at Sep 04, 2008, 10:27 AM

              This is not possible with the current snippet. But you could add some additional fields to the form and add a bit of code to create the paths on upload.

              // Initialise
              if ($uploadtv != '')
              {
                $tmp_tv = $modx->getTemplateVar($uploadtv);
                $path = $modx->config['base_path'].$tmp_tv['value']; 
              }
              else if ($path != '')
              {
                $folder = $modx->getTemplateVar('folder');
                $path = $modx->config['base_path'].$path.$folder['value'];
              }
              else
              {
                return $_fu_lang['error_no_path'];
              }
              


              I added this code which seems to work (as long as my TV has a / at the end of it, but now it wont create the folder. I’ve been trying to piece this together with my limited coding knowledge but it has been driving me nuts. How do I put the / in the code so my TV’s don’t have to have it and allow it to create the folder. I see where it makes the folder in the code but no idea how to edit it to make the folder with the TV path.

              Any help?
                • 19726
                • 239 Posts
                Quote from: 2wistd at Sep 17, 2008, 08:23 AM

                I added this code which seems to work (as long as my TV has a / at the end of it, but now it wont create the folder. I’ve been trying to piece this together with my limited coding knowledge but it has been driving me nuts. How do I put the / in the code so my TV’s don’t have to have it and allow it to create the folder. I see where it makes the folder in the code but no idea how to edit it to make the folder with the TV path.

                Any help?
                The . operator that is used in the code just concatenates several strings. So you could append a slash like this:
                $path = $modx->config[’base_path’].$path.$folder[’value’]."/";
                  • 87
                  • 51 Posts
                  Quote from: Mitch at Sep 17, 2008, 11:07 AM

                  The . operator that is used in the code just concatenates several strings. So you could append a slash like this:
                  $path = $modx->config[’base_path’].$path.$folder[’value’]."/";

                  I missed the . before. I tried several ways but not the .
                  I’m learning slowly.
                  Now need to figure out how to create that folder
                    • 21946
                    • 283 Posts
                    Hello
                    I can’t achieve to upload a zip file from firefox on my site with this snippet (allowed extensions are ok in my call). It works fine with pictures. Anyone know why?
                      [url=http://www.savepoint.fr/index.php?id=38] -petits tuyaux pour les d
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Depends on a number of things. Perhaps you have a PHP or an Apache configuration causing the failure. What is the size of the .zip file? What error messages are returned (or check the Event Lot in Manager -> Reports).
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org