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
    And it's back to not finding the path... All of a sudden, can't find it.

    I'm using this:
    [[!FileUpload? `&filefields=`3` &uploadgroups=`Administrator, fileUploader` &allowoverwrite=`1` &extensions=`jpg,pdf,doc,docx,xls,png` &path=`assets/uploads/cswa/`]]


    Removing
    &allowoverwrite=`1` &extensions=`jpg,pdf,doc,docx,xls,png`

    which is the only thing I changed, doesn't fix it.

    I still don't get the uploadTV part either. If I select the type as file, it wants a file. Not a directory. What type am I supposed to use to use a TV path, or a default path?
      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
      The message is definitely coming from FileUpload. The attempt to create the directory is failing. Creating the directory yourself would solve it, if that works for you (probably not).

      First, make sure you have &createpath=`1` in the snippet tag.


      If that doesn't work, try changing line 148 of the snippet from this:

      mkdir($path, 0777);


      to this

      mkdir($path);



      mkdir can be fairly fussy, and the location where you are trying to create the directory in must have the Execute permission for the owner trying to create it, regardless of if the folder is Readable, or Writable.



      ------------------------------------------------------------------------------------------
      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
        The directory is created, and I did actually upload two files to it. Once on local, and once on the server just before it broke.
        I will however, check to be sure when i'm closer to the machine with a normal sized screen.
          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
          I'm not sure what that would mean.

          This might break things altogether, but you could try taking the trailing slash off your path property. I think Windows servers have a problem with a trailing slash in mkdir().

          TBH, I don't know why the recursive mkdir function is there in the code. It was in the code when I ported it from Evolution so I left it there, but mkdir() has had a 'recursive' argument for a long time, so it should really be unnecessary.

          When I have time, I'll try to get out a new version with (hopefully) more tolerant code.

          OTOH, that really shouldn't cause your problem because if the directory already exists, that mkdr code shouldn't run. That suggests some kind of permission or ownership problem where that directory is invisible at the time the snippet runs.



          ------------------------------------------------------------------------------------------
          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