Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PDF extension changed to DOC

Explorer ,
Aug 14, 2008 Aug 14, 2008
I'm using Verity and ColdFusion 8. I'm displaying the hyperlink of a pdf, but when it displays, it shows as a doc file. It still opens the pdf, but I would like to show the correct extension. Here's my code:

<!--- HREF to file is produced using either FILE protocol
or HTTP, depending on whether this is a web document.
so, we'll look at the file ext to determine if it's
a web doc or not --->
<cfset FileName=GetFileFromPath(Key)>
<cfset Ext=ListLast(FileName, ".")>
<!--- Display title if there is one, else name --->
<cfif Trim(Title) IS "">
<cfset display=GetFileFromPath(Key)>
<cfelse>
<cfset display=title>
</cfif>
<!--- Now display it --->
Key=#Key# <br>
display=#display# <br>
<a href="#url#">#display#</a> (#score#)

And here's what it returns. Out of about 300 pdfs listed, it only displays 3 as a pdf, all others are showing as a doc file.

Key=C:\ColdFusion8\wwwroot\Decisions07\Corporation\0718719 & 0719549.pdf
display=Microsoft Word - 18719 & 19549.doc
Microsoft Word - 18719 & 19549.doc (1.0000)
324
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Aug 14, 2008 Aug 14, 2008
I think I figured it out. display was being set to title. But I don't know how title got set to that Microsoft title. Weird. Anyway, I'm happy for now. Thanks.
Translate
LEGEND ,
Aug 14, 2008 Aug 14, 2008
What is the value of the title variable?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2008 Aug 14, 2008
title = Microsoft Word - 18719 & 19549.doc

I don't know why but it's also adding "Microsoft Word - " to the title. The real name of the pdf file is 18719 & 19549.pdf.

Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 14, 2008 Aug 14, 2008
I think I figured it out. display was being set to title. But I don't know how title got set to that Microsoft title. Weird. Anyway, I'm happy for now. Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 15, 2008 Aug 15, 2008
the title was set to that because that is the title stored in the pdf's
metadata/properties (?). your pdf must have been created from a word doc
and all word doc properties (title, author, summary, etc etc) were
imported into the pdf. when verity indexes pdf files, it looks into file
properties stored in the file.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 18, 2008 Aug 18, 2008
LATEST
Thanks for that clarification. Yes, they did come from Word. I was totally confused as to where it came from. Thanks again.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources