We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36605
    • 70 Posts
    Hey, I was trying to use an upload form, and I realized that the upload snippet is only for 9.5; no 9.6. So I was wondering how exactly I should go about doing the upload without the snippet (whereas I don’t know enough advanced html to really do it on my own).

    Also, I was wondering about log-in things. There’s so many snippets, etc. out there, and I’m not sure what to use. All I want is that if they aren’t logged in, they can log in, and that once they have logged-in, they have access to a page (not get redirected to that page, just have access to it - its for uploading and email), and also for an admin link for those who are admins. How would I go about doing this? I was thinking of doing another menu section with extMemberCheck, but I need to also have a log-in screen before that...
      • 7231
      • 4,205 Posts
      I realized that the upload snippet is only for 9.5; no 9.6.
      I think that it should work, did you try it or are you going by the ’works with’ notice in the repository page. If you have not tried it out, test it and see how it goes.

      http://www.modxcms.com/FileUpload-804.html

      For login stuff use weblogin or the new weblogin PE. To make a page private you need to set a user group and allow only that user group to have access to that document. Private pages will only show up in the menu once logged in, however I think that both ditto and wayfinder have functions to allow the page to show up on the menu. You can also use the personalize snippet to reveal content once logged in, useful for having secret menus.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 36605
        • 70 Posts
        Well I tried it, and then saw that it didn’t say that it worked...Here’s my content for the uploading page:
        [[FileUpload $extensions=`zip,jpg,bmp,doc' $maxsize=4194304 $tpl=`upload1` &path=`/assets/uploads/`]]
        
         
        
        Hi  


        I just put in the hi to make sure it works. The rest is just like blank content. When I put the chunk in on it’s own, I can see it all (though I know it doesn’t work on its own).

        ---------------------------

        So if I just make everybody in the same usergroup, I can do it? Is there a simple way to make everybody in the same usergroup when they register?
          • 7231
          • 4,205 Posts
          [[FileUpload $extensions=`zip,jpg,bmp,doc' $maxsize=4194304 $tpl=`upload1` &path=`/assets/uploads/`]]


          There are a few errors in your call:

          1) You have a ’ at the end of the extensions, remember to always use ` (backticks) rather than single quotes ’.

          2) In the call you should use & to identify the parameters not $.

          3) You need a ? after the snippet name and before the parameters. [[FileUpload? &extensions...

          4) this is not an error but can help at times, when [[shippet]] does not work try the uncached version [!snippet!].

          Corrected it would look like:
          [!FileUpload? &extensions=`zip,jpg,bmp,doc` &maxsize=`4194304` &tpl=`upload1` &path=`/assets/uploads/`!]


          The documentation has a good example of how to use it.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 19726
            • 239 Posts
            Just to confirm, the FileUpload snippet works on 0.9.6 and it is now also updated in the repository. Another thing to make sure is that you _MUST_ call it uncached (so between [! !]).
              • 36605
              • 70 Posts
              hey, thanks man! I must’ve been more tired than I thought last night when I did that... hah