We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25046
    • 194 Posts
    I need a simple way for my client to create a link on a page to a pdf file and, at the same time, be able to upload the pdf file that will be linked.

    Ideally, he will be able to select some text, click the link button, select or upload the PDF file to any folder, then click OK and the link will work. Unfortunately, the system does not allow me to select folders to choose from nor does it allow me to upload a pdf file. I’m sure I’m missing something simple here.

    Any suggestions? Thanks!
      • 36624
      • 535 Posts
      you can use tinyMCE link option...
        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
        • 25046
        • 194 Posts
        Yes, I have tried to use TinyMCE however it does not let me change directories, does not let me create new directories and when I try to upload a small PDF test file to the default directory, I get an error message that says "invalid XML response from connector".

        I imagine i need to set some permissions somewhere to be able to allow uploads. Where would that be?

        Thanks
          • 25046
          • 194 Posts
          This seems like such a SIMPLE thing to do yet I am completely baffled as to how to do it in ModX. I imagine there are a bunch of settings and configurations that need to be made to allow this but it is certainly not clear to me what these are. I did go to Tools>Configuration and I checked the "uploadable file types". It looks OK as it includes PDF as as file type. My File Manager path also "seems" OK as it was automatically generated and seems to point to the site root. The maximum upload size also looks OK. When I check the Manager Users permissions, all the uploadable file type settings have been checked to use the System Configuration settings. Is there something i am missing?

          Again, I just want to create a simple link on a page to go to a PDF file that I will upload at the same time - or have already uploaded. That’s where I am stuck!

          huh
            • 7231
            • 4,205 Posts
            The path that you need to look into is the Resource Path. The File Manager path is related to the File Manger module, not the Resource Browser.

            The Resource path should point to your assets folder, not the root.

            MODx will set the paths automatically when possible, they may not always be correct (but usually are). If you are not using the default admin (ID1) then you need to make sure that the checkboxes to use the defaut file types and paths is selected. Sometimes these may not have been selected when creating new users.

            Make sure that the upload folders have the correct permissions to upload files to.
              [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]
              • 25046
              • 194 Posts
              Great, thanks. What should these permissions be? 777? or something different? Also, if i set the assets folder permissions to 777, will that create some sort of security hole for the other items in the assets directory? Just want to make sure.

              Thanks
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                It depends on your system’s configuration. If PHP is an Apache module and no suexec features are configured, then all of your php scripts are running as the Apache user, not the file owner’s user (you). This means any folders your scripts will want to write to (such as writing cache files to the /assets/cache folder) need to be writable by everybody (777), since you own the folder, but the script writing the files are running as a different user. You need to have any folders that a script will write to set to 777. The usual "suspects" are the assets/cache, assets/files, assets/images and assets/exports folders. If you are using something like MaxiGallery you’ll need to set its assets/galleries folder to 777 as well. Don’t set anything 777 that you don’t have to.

                If your system is configured to have a script run as the file’s owner (suexec of some kind or another) then when the script (php file, in this case) runs it gets changed to run as the owner (you). In this case, the folders don’t need to be world-writable, just owner-writable (755, usually) I make sure any hosting I use has this configuration, since it is more secure.

                As far as the paths are concerned, after you make sure the two places in the site configuration where these are specified (one for the resource browser in the rich text editor and one for the Manager’s file manager) are set correctly, you need to make sure the individual manager users also have the correct settings. You can check the "use system default" box, or specify exact paths for each user.

                You can determine your correct file paths by looking at Reports -> System Info, then clicking on the phpinfo link. Server settings, including path information, are at the bottom of the phpinfo report.
                  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