We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13137
    • 204 Posts
    Sweet snippet!

    But, I have the call at the bottom of a page, so every time you click on a folder, the page reloads, and you have to scroll down to find it again.

    Has any body tried to tie this together with some ajax, so that it can follow folders without reloading the whole page?

    I started to look at:
    http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
    and
    http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

    The second link (although not ajax) does more or less what I want, but then I have to add another custom css.

    Any incite from people more experienced?
      • 31471
      • 206 Posts
      This is not ajax but may give a new aspect to your problem:
      You can assign any template to each FD call.
      So if you are able to show/hide divs in js, you could generate all of the possible views on load, then hide/show them as needed.
      You can make a ’root’ one, which calls FD many times to collect all of the subdirectories in divs with different ids. Each folder’s <a> tag could show/hide it’s own div on click.
      ..just a raw idea.
        • 15082
        • 195 Posts
        Very useful plugin - I love it!

        As I’m in Germany, I’ve a question:
        Is ist possible to have the snippet working with umlauts (ä = &auml;, ö = &ouml;, ü = &uuml; and ß = &szlig;)?

        Would be very nice, if someone has an idea  smiley

        Greetz
        JUSI
          • 7455
          • 2,204 Posts
          I am getting a error:
          « MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource:
          « PHP Parse Error »

          PHP error debug
          Error: array_merge() [function.array-merge]: Argument #2 is not an array
          Error type/ Nr.: Warning - 2
          File: /var/www/vhosts/XXXXXX.nl/httpdocs/assets/snippets/filedownload/filedownload.class.inc.php
          Line: 146
          Line 146 source: $this->allFiles = array_merge($this->allFiles,$this->getFiles($this->_config[’getFolder’]));

          does anyone know how to fix this?
            follow me on twitter: @dimmy01
            • 31471
            • 206 Posts
            Make sure you point the snippet to a folder that exists. Or:
            Lines around 444:
            			} else $files[] = $this->_lang['dirOpenError'].$path; // added []
            		} else $files[] = $this->_lang['notaDir'].$path; // added []

            Or:
            		if (is_array($this->getFiles($this->_config['getFolder']))) {
            			$this->allFiles = array_merge($this->allFiles,$this->getFiles($this->_config['getFolder']));
            		}

            I know this way we call the getFiles() function twice.
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              I can’t seem to get the delete function working with this... I have put &deleteGroups=`users` and tried all the different placeholders but nothing seemed to work.

              Could someone tell me how they managed to get the delete option working?
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 36624
                • 535 Posts
                hello.

                I’m using filedownload with the plugin and all is working great. I use the browseDirectories setting and i’m trying to find a way to upload files when browsing the folders.. So i’m tring to grab the value from [+fd.path+] to use it as a param for the FileUpload Snippet and i’m stuck with my little code...

                line: 453 of filedownload.class.inc.php
                <?php //for color 
                function getDefaultLayout() {			
                	//****** add an Fileupload call, trying to set the path dynamically.
                	        global $modx;
                		$myPath='assets/files/modules/'.$this->_config['curRelPath']; // build a dynamic path 
                			$t= '<table>'; 
                			if ($this->_config['browseDirectories']) {
                				   $params['tpl']='FileUploadForm';
                				  // $params['path']= $myPath; //doesn't work!
                				  // $params['path']= 'assets/files/modules/[+fd.path+]'; //doesn't work! 
                				   $params['path']= 'assets/files/modules/module-1/'; // works great..  
                				   $params['uploadgroups']='support';
                				   $params['extensions']='txt';
                				   $snippetFileUpload=$modx->runSnippet('FileUpload', $params);
                	 			$t .= 'debug:'.$myPath.'<tr[+fd.class+]><td colspan="4"><strong>Path: [+fd.path+]</strong>'.$snippetFileUpload.'</td></tr>';
                			}		
                	//**************************
                


                maybe a php pro can tell me what i’m making wrong.. ?
                  CTRL+SHIFT+U - Clear Cache
                  CTRL+SHIFT+H - Hiding Heft Panel
                  CTRL+SHIFT+N - Fast Create Resource
                  CTRL+ALT+P - Preview Recource (in edit resorce window)
                  CTRL+ALT+S - Save
                  • 36624
                  • 535 Posts
                  in the meanwhile, i was working with v2.6 ( from repository ) and i think i found a little bug.

                  "&deleteGroups" is not working as expected. It show the links even if the user is not in the group...

                  rollbacking to the version v.2.5(beta) found on http://www.muddydogpaws.com/development/filedownload/download.html solved the problem...


                    CTRL+SHIFT+U - Clear Cache
                    CTRL+SHIFT+H - Hiding Heft Panel
                    CTRL+SHIFT+N - Fast Create Resource
                    CTRL+ALT+P - Preview Recource (in edit resorce window)
                    CTRL+ALT+S - Save
                    • 25551 ☆ A M B ☆
                    • 1,231 Posts
                    I can’t get the delete link to work at all. I tried 2.6 and 2.5...
                      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                      AugmentBLU - MODX Partner

                      BLUcart - MODX Revolution E-Commerce & Shopping Cart
                      • 25551 ☆ A M B ☆
                      • 1,231 Posts
                      Can someone explain how to allow web users to delete an uploaded file please. I can’t seem to get the delete function to work even in the manager.


                      Thank you.
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart