We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    "could not create path to upload directory." is what displays on the page with the fileUpload snippet.

    I'm calling it in the content field, if that matters. As below:

    [[!FileUpload? &uploadfields=`10` &uploadgroups=`Administrator, fileUploader` &path=`assets/uploads/cswa/`]]


    I've tried using this also, with the same result:

    &uploadTv=`UploadPath`


    I'm a little unclear on what kind of TV this should be as well if I was going to use the @INHERIT some/path/ default. Text?

    [ed. note: frogabog last edited this post 14 years ago.]
      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
      Well now... It just started working. Somehow there was a span inserted in the snippet call. Weird, cuz I pasted that one manually in the html editor and I remember removing the paragraph tags at one point too.

      Still unclear about the TV type though, it'd be nice to use that instead.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Probably a file input type and raw output. Might be a good use for a restricted Media Source for that TV.
          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
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          It's now set to file, and default. But I can't select the folder in the resource viewer. It's not a file, so it won't select.

          hmmm...

          Oh, it's also only pulling up 5 upload fields. I don't need ten, one will be fine but I didn't bother to change it from the example yet.
            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
            I can't seem to get the allowed extensions to work. When I try to upload a .jpg, it says it's not allowed. I did set it to only allow certain file types. What could be wrong with this?

            [[!FileUpload? &filefields=`3` &uploadgroups=`Administrator, fileUploader` &path=`assets/uploads/cswa/` &extensions=`png,pdf,doc,xls,png,html`]]
              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
              • 3749
              • 24,544 Posts
              MODX has it's own allowed file types in a system setting (upload_files), though jpg is there by default. Also, note that they're case-sensitive, so you may need to add .JPG if the filename has it in uppercase.

              Can you tell if the "not allowed" message is coming from FileUpload or MODX? What's the exact message?




              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                I've moved this site to my server, and as expected a lot of the errors I've been dealing with are now a non-issue.

                Except this one. But it seems as if it's due to me entering the parameters for only certain files into the snippet call. I removed the parameter, and am able to upload just fine.

                So, here's what I was using. What's wrong? I tried both with and without (.) before the extension.

                [[!FileUpload? &filefields=`3` &uploadgroups=`Administrator, fileUploader` &extensions=`.jpg,.pdf,.doc,.docx,.xls,.png` &path=`assets/uploads/cswa/`]]


                I'd leave it as is with all the defaults, but it lists the whole gamut of file extensions on the page. The users will only have a few different file types they'll upload anyway.

                The error came from fileUpload and showed in red just above the file upload fields, it said that the .jpg file was a disallowed extension.

                It happened both with and without the (.) preceding the extension in the snippet call.

                I haven't checked to see if the default TV works yet on this server. FWIW, I installed a brand new 2.2.4-pl at the root of the server, and then imported the tables from my local. Site works great. Still waiting for full propagation of the nameservers but the front end is up.

                Right now I still have to use the temporary url (http://site.com/~username/manager) to access the manager. I'm gonna give that 48 hours I suppose. What's interesting is that I can access the login screen for site.com/manager, but I can't log in from there. It just loops back to login. The only way to get to manger is to use the ~username/manager url.

                edit: Also note, the parameter &filefields=`3` in the snippet call. I tried &uploadfields but that just sent the default 10. &filefields works great. The tutorial at http://bobsguides.com/fileupload-tutorial.html shows &uploadfields in the example. [ed. note: frogabog last edited this post 14 years, 1 month ago.]
                  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
                  Another weird thing...

                  When I leave the extensions out of the snippet call, I get all the system extensions listed. That'd be fine, however for some reason this <p> falls off the side of the div.

                  For now, I've created a new outerTpl chunk that omits this section entirely which almost does the trick, but does not solve the irregularities with the original fu.outer.tpl calling up the extension list that overflows... like forever.

                  The css seems ok, and when I view the <p> section in firebug it shows the margins just fine, but the text still falls out of the div. I tried to add a responsive "row" container, and additionally a "twelve columns" div wrapping the paragraph, which by all accounts should have contained it, but it doesn't.

                    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
                    • 3749
                    • 24,544 Posts
                    Can't help with the CSS, but if you take the . out of the extension list and clear the cache really well it should work as long as the case of the file matches an extension. This is only useful of you want to restrict the user to a smaller set of extensions or allow extensions that you don't want to add to the system setting (which is used if you leave out the property).

                    &extensions=`jpg,pdf,doc,docx,xls,png`


                    If that doesn't work, PATHINFO_EXTENSION may not be set for some reason. This would be a fallback:

                    replace this line in the snippet:

                    if ($extensions!='' && !in_array(pathinfo($uploadfile, PATHINFO_EXTENSION), $ext_array)) {


                    with this:

                    if ($extensions!='' && !in_array(substr($file,0,strrpos($file,'.')), $ext_array)) {



                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      &extensions=`jpg,pdf,doc,docx,xls,png`


                      That works. WTH did I do wrong writing that other than the silly order of extensions? (I did try without the period, and thanks for re-ordering btw) Copying and pasting your code fixed it up. I still don't see what I did wrong... but ok. Thanks again Bob.
                        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