Download & Extend

Filepath/URI handling in Search Files Attachments

Project:Search Files
Version:6.x-2.0-beta3
Component:Search Attachments
Category:task
Priority:normal
Assigned:thl
Status:closed (fixed)

Issue Summary

The README.txt for Beta3 lists a task we need some url/path rewriting. The issue is that the files being indexed are stored in paths somewhere in the filesystem but later on, to retrieve these files when they are part of a search result, a hypertext reference is needed with appropriate paths in the URL. The problem is that also filesystem and URL paths are quite similar they are not identical. That's why I was thinking of url/path rewriting. However, after digging deeper into the topic I came to the conclusion that files in attachments and files in directories need to be handled differently.

This task is dedicated to files in attachments.

Files in attachments are entirely under Drupal control. They are uploaded as part of content management, listed in the core "files" table, listed in nodes and retrieved through standard Drupal functions. Everything using filesystem paths relative to the Drupal core installation.

The following items are to be implemented past Beta3:

  • Stick with the existing Drupal API and data structures.
  • Keep and leverage the (relative) filepath information in the files table.
  • Handle relative and absolute (not seen so far) paths identical and do neither manipulate filesystem nor URL paths in own code. In other words, throw away the idea of url/path rewriting.
  • Use realpath() only immediately before getting fileinfo() and running external helpers. This allows data relocation through symlinking and remounting at any time with no need for re-indexing.

Comments

#1

#2

Status:active» needs review

fixed, see search_files_attachments.module revision 1.1.2.15

#3

Status:needs review» fixed

#4

Status:fixed» closed (fixed)