[BD] Attachment Store - Exclude certain file types

Discussion in 'Other' started by Russoroni, Jan 23, 2014.

  1. Russoroni

    Russoroni New Member

    Is there a way I can exclude certain filetypes from the amazing effects of Attachment Store? I have a custom plugin for displaying maps from GPX & KML files. I need for these files to be stored locally.

    Thanks.
     
  2. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Hmm, yeah. I can add a new field for you to configure some extension to ignore I guess. Will that work for you?
     
  3. Russoroni

    Russoroni New Member

    That would be great!!! I'm looking at it right now and this is what is happening... With my custom plugin, when I upload a GPX file for example, it doesnt go into the attachments directory. It goes into a directory called 'filedemo' but now with Attachment Store installed, the GPX file still goes into 'filedemo' but the file has no data.
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @Russoroni Hmm, I'm a bit worried that even with the extension ignore option, it will not work since your add-on doesn't seem to work with default XenForo attachment system anyway...
       
  4. Russoroni

    Russoroni New Member

    But it worked fine until I installed attachment store. It still uses the attachment system but it dumps gpx, kml, kmz & tpo files into a different directory. I'm not exactly sure if it goes into the attachments directory first and then to filedemo but something is messing with it now.
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @Russoroni Okie. I will add the new option now and we will see.
       
      Russoroni likes this.
      1
  5. Russoroni

    Russoroni New Member

    I dont know if this helps but here is some of one of the plugin files...

    $file = $_SERVER['DOCUMENT_ROOT']."/internal_data/attachments/0/".$att_id."-".$hash_code.".data";
    // Open the file to get existing content
    $current = file_get_contents($file);
    // Append a new person to the file

    // Write the contents back to the file
    $ourFileName = $_SERVER['DOCUMENT_ROOT']."/library/filedemo/".$att_id."-".$hash_code.".".$ext;
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
     
    xfrocks likes this.
  6. Russoroni

    Russoroni New Member

    Well... I like how fast you cooked this up and it IS working but I'm still having the problem lol... If I show you my plugin files do you think you could see what the problem is? They are not large or complex. I will PM them to you.
     
  7. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Yes, please do. You can start a conversation with me on the site, you can upload attachment there.
     
Loading...