We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38441
    • 140 Posts
    Has anyone tried to use FileUpload? Using Revo 2.2.0pl i have downloaded and installed this add on via package management and added the tag into a test page as instructed-
    [[!FileUpload]]
    but all i see on the page is a message reading 'no path to store the files was given'

    Any hints or advice would be appreciated.

      • 22840
      • 1,572 Posts
      Is it Bob's one that you've added ?

      If so you will need to add the path to the uploads folder and the groups that are allowed to upload, EG:

      [[!FileUpload?
          &uploadfields=`20`
          &uploadgroups=`Administrator,Editors,Subadmins`
          &path=`uploads/mygallery/picnic/`
      ]]


      More info on Bob's site http://bobsguides.com/fileupload-tutorial.html
        • 38441
        • 140 Posts
        Thanks. Yes it is Bob's add-on i'm using. The file upload would be on the public facing front end of the site, it's for visitors to upload images, so is it necessary to specify user groups?
          • 22840
          • 1,572 Posts
          Never used it before so might be best to see if Bob comes along to give you an official answer, however, my own opinion would be yes due to security reasons, you don't want just anybody coming along and uploading anything that can harm the site / server
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Anybody planning to host user-generated content needs to read this. http://googleonlinesecurity.blogspot.co.il/2012/08/content-hosting-for-modern-web.html
              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
              • 38441
              • 140 Posts
              Ok, cheers, i picked up the security considerations to take into account when looking into this. Just to elaborate, the file upload feature is to be used on a 'comment' section for blog posts (i'm using Articles and Quip). So visitors leaving a comment can also upload a picture, relating to say their vacation which is what the website is about. I also need another file upload feature on a different site being built which will be for the purposes of uploading artwork files for an Online print store, although on that site i haven't got to that part yet. I wouldn't know any PHP whatsoever, or else i'd just create a standard upload form and place it on the page, and use the appropriate snippets etc. inside Revo.
                • 38441
                • 140 Posts
                Oh, and any images uploaded as part of a comment would presumably be sent into the manager, and then need to be approved by the moderator.
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  I don't believe user groups are necessary for FileUpload to work, however the path or &makedir parameter is essential. It does also deserve to be noted again, if anyone can upload... bad anyones can upload too. Really scary idea allowing anyone to put files on your server IMO.

                  Some things I've noted:

                  • Make sure to edit the snippet call in text or html view. Not rich text. That can gork a snippet call.

                  • Along the same lines, check your back ticks. They should not be ticks, but make sure to use the back tick under the tilde on your keyboard. Also, check for any incorrectly placed back ticks. I found one preceding a parameter and it absolutely wonked the path.

                  • Check the slashes, FileUpload path needs a trailing slash, with no preceding slash. If the directory isn't created, it won't find it with &path=.

                  • Check spacing of the paramaters in the snippet call. Spacing can gork it.

                  • Check for any &: in text or html view and turn them back into & preceding the parameter. I know MODX is supposed to read these properly, but it's worth changing if they got converted by a rich text editor.

                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                    • 10208 ☆ A M B ☆
                    • 1,780 Posts
                    Oops, that took too long to get posted.

                    So, if this is for an image, make sure to exclude all other file types. That should save your server. However, bear in mind that this snippet makes the file upload to the selected path. This means, even if the comment is not approved, the uploaded file will be in the directory, on your server.

                    Making the file type only allow .jpg, and also limiting the file size would be helpful for security.

                    As far as using "standard" snippets for Revo, FileUpload would be a standard snippet/extra. Amongst a couple others IIRC. Writing new snippets is silly when Bob and others have put the time into them already. They can always be modified as well.
                      Frogabog- MODX Websites in Portland Oregon
                      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                      Having server issues? These guys have MODX Hosting perfected - SkyToaster
                      • 38441
                      • 140 Posts
                      Ok, cheers guys. I'm about to go thru these responses in much more detail but the first things that stand out- it's bad to allow anyone to upload files to a server, so how does every Online print store on the planet deal with the public uploading 'files' to their site? (large artwork files to be printed). And what is IIRC? I know snippets can be modified but i'm not a developer and couldn't decipher a line of PHP / read or write it for all the tea in China. Thanks again, i'm going to study this and see if i can achieve my goal here.