We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29774
    • 386 Posts
    therebechips Reply #1, 18 years ago
    I have found that a TV of type ’File’ does not allow you to actually upload a file when managing a document. That is, you can choose a file to upload, save the document, but the url of the file is not saved in the database and the file is not uploaded to the server. Has anyone else encountered this? Where are the files meant to be uploaded to?

    Web Server: Apache
    ----------------
    PHP version: 4.41
    MySQL version: 4.1
    Operating System and version: Mac OS X 10.4

    Browser/Client:
    -----------------
    Browser name and version: Firefox (Also tried Camino, Mozilla)
    Operating System and version: Mac OS X 10.4

    Many thanks in advance.
      Snippets: GoogleMap | FileDetails | Related Plugin: SSL
      • 29774
      • 386 Posts
      therebechips Reply #2, 18 years ago
      Ah ha. I’ve narrowed the problem down to this file: ’/manager/processors/save_content.processor.php’ (Lines 176 to 227).

      Solved the issue by commenting out the above code entirely and editing ’/manager/includes/tmplvars.inc.php’ to make FCKEditor handle file uploads instead using the resource browser (don’t really understand why this isn’t done by default?):

      /manager/includes/tmplvars.inc.php Lines 164 to 167, replaced with:
      case "file": // handles the input of file uploads
      global $_lang;
      global $ImageManagerLoaded;
      global $content,$use_editor,$which_editor;
      if (!$ImageManagerLoaded && !(($content[’richtext’]==1 || $_GET[’a’]==4) && $use_editor==1 && $which_editor==3)){
      $field_html .="
      <script type=\"text/javascript\">
      var lastImageCtrl;
      function OpenServerBrowser(url, width, height ) {
      var iLeft = (screen.width - width) / 2 ;
      var iTop = (screen.height - height) / 2 ;

      var sOptions = ’toolbar=no,status=no,resizable=yes,dependent=yes’ ;
      sOptions += ’,width=’ + width ;
      sOptions += ’,height=’ + height ;
      sOptions += ’,left=’ + iLeft ;
      sOptions += ’,top=’ + iTop ;

      var oWindow = window.open( url, ’FCKBrowseWindow’, sOptions ) ;
      }
      function BrowseServer(ctrl) {
      lastImageCtrl = ctrl;
      var w = screen.width * 0.7;
      var h = screen.height * 0.7;
      OpenServerBrowser(’".$base_url."manager/media/browser/mcpuk/browser.html?Type=files&Connector=".$base_url."manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=".$base_url."’, w, h);
      }
      function SetUrl(url, width, height, alt){
      if(!lastImageCtrl) return;
      var c = document.mutate[lastImageCtrl];
      if(c) c.value = url;
      lastImageCtrl = ’’;
      }
      </script>";
      $ImageManagerLoaded = true;
      }
      $field_html .=’<input type="text" id="tv’.$field_name.’" name="tv’.$field_name.’" value="’.$field_value.’" ’.$field_style.’ onchange="documentDirty=true;setVariableModified(\’’.$field_name.’\’);" />&nbsp;<input type="button" value="’.$_lang[’insert’].’" onclick="setVariableModified(\’’.$field_name.’\’);BrowseServer(\’tv’.$field_name.’\’)" />’;
      break;

      Basically does the same as the image TV but for files. For future ref: above applies to version 9.1.
        Snippets: GoogleMap | FileDetails | Related Plugin: SSL
        • 32241
        • 1,495 Posts
        therebechips, nice catch...
        Could you post it to the bug system so we can track them down and release it for v0.9.2? wink
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
          • 29774
          • 386 Posts
          therebechips Reply #4, 18 years ago
          I’m wrong, I think. The file was not uploading because it was corrupted. Interestingly, FCKEditor had no problem uploading the corrupted file. I recreated the file (pdf) and now the default file upload works as expected.

          I have added the FCKEditor uploading for TV type ’File’ as a feature request in the bug tracker, as I believe asset management should be consistent throughout the manager.
            Snippets: GoogleMap | FileDetails | Related Plugin: SSL
            • 7455
            • 2,204 Posts
            I had the same problem used richtext instead
            would be nice to be able to set if the file is a link and what title it would get (filename ore othername)
            and use the resourcebrowser ofcourse much better
            dimmy
              follow me on twitter: @dimmy01