Filepath and Content_URL
What is the difference between the content_url field on the FILES table and the ifs_filepath field on the FILE_INFO table? How can the filepath field be utilized for SDK and other programs? Why is the content_url field sometimes null?
CONTENT_URL is used to store the link to indexing content for the file. I cannot say for certain that if CONTENT_URL is null then the file has not been indexed, but that is the obvious conclusion. IFS_FILEPATH stores the directory/file name for where the file is located on the primary file manager server. If the file is also located on a distributed/local file manager, there will be a value in HFS_FILEPATH.
Thanks Kevin, I think you might be on to something there. Looks like only doc, pdf, txt, xls, and xml files are being indexed in our system as those are some of the file types supported under Full Text Search. Docx is not supported so its content_url field remains null.
Looks like we can use content_url as a sort of ‘back door’ to get files. Is there a way to use the ifs_filepath column in SDK to get and read files?
CONTENT_URL will not get you the file per se, but it will get you what was indexed from the file, so far as I understand it.
IFS_FILEPATH should enable you to open the file, but you will have to include the base directory of the file vault to get the full directory path for the file. Other than that, yes, I could see it being used to open a file.
I’ve been able to get the file off of the CONTENT_URL using BufferedOutputStream from a URL.openStream() via Java, though the CONTENT_URL field only lasts a little bit before it’s nullified. I’m looking to see if I can run that same method using the IFS_FILEPATH instead. I tried appending the FileManger URL +’C:AgileFiles’ (base_storaged_dir) + IFS_FILEPATH to see if I can use a direct URL to a file but it hasn’t succeeded. Any ideas there?
Do not append the FileManager URL with C:/AgileFiles/ (base storage directory of vault) + IFS_FILEPATH. The vault’s base storage directory path concatenated with the IFS_FILEPATH is sufficient enough to get the physical files. Let me know if that works.
I might be missing some small detail but I can’t seem to figure it out. I’ve tried many combinations but keep getting a Tomcat “The requested resource XXXX is not available” error.
Is this anywhere close to how we should get a file directly (to give out a more concrete example)?
Matt, please do not add the http://agile:port/Filemgr/AttachmentServlet before the IFS_FILEPATH value you get from DB. What should be concatenated as a prefix with that value, is the base storage directory folder path which you will get either from vault table of DB or from java client configuration of file manager. So if the base storage directory of your system is defined as C:\AgileFiles\
then you should be using this to get the file from the vault:
InputStream is = new FileInputStream(new File(“C:/AgileFiles/000/770/474/agile77047111.pdf”));
Thanks for your help, Swagoto,
The input stream is precisely the end goal of my original question – thanks for reading my mind!
It didn’t work for me though – if it does for anyone else, that’s great. Looks like within Agile API I can make it work off of an InputStream is = ((IAttachmentFile)row).getFile() per the Agile API user guide. I have both ‘C:\Agile\Files’ (test server) and ‘D:\Agile\Files’ as my base_storage directory so when I tried InputStream is = new FileInputStream(new File(“C:/Agile/Files/000/770/474/agile77047443.pdf”)); I received the java.io.FileNotFoundException “C:AgileFiles?0’4agile77047443 (The system cannot find the file specified)”.