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

cffile upload question

Participant ,
Jun 03, 2010 Jun 03, 2010

I have a form where users are required to upload documents, word, excel, gif, jpeg, anything.

I  use cffile upload :

<cfset uploadFolder = ExpandPath("./uploadFolder/")>
<!--- Upload the file(s) to a temporary folder --->
<cffile action="upload"
        filefield="attachmentFile"
  destination="#uploadFolder#"
  nameconflict="makeunique">

I then use a simple insert to put all the data into a table, including the uploaded docuemnt. The document column name is documentName and I  use  '#cffile.serverFile#' to insert. When I look in the table, everything is there and appears fine. The various uploaded docuemnts are someting line word_doc1.doc, word_doc2.doc, excel1.xls, picture1.gif, etc....differenent formats.

My question is when I retrieve the data for output, the documents just come out displayed as word_doc1.doc, word_doc2.doc, etc.....What do I need to do to display the actual word document (or excel, or gif.,etc.) instead of just the name.

I looked at another application and the uploaded document is moved to anohter folder and then opend as a link, but I dont think I can do that here.

What do I do to display the actual document ? Thanks

TOPICS
Getting started
396
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 ,
Jun 03, 2010 Jun 03, 2010
LATEST

I assume you are storing the path to the document in your db.  Once you know where the file is, you have to open it somehow.   You might be able to do it with cfheader and cfcontent.  Office 2007 is strange when playing with coldfusion, but since these are real office files, it might just work.

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