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

Auto upload file created by cfcontent

Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Does anyone know if it is possible to automatically upload a file to a server after cfcontent generates the file?

What I am doing now is filling out forms that when submitted update the contents in a database and also spit out a generated Microsoft Word Doc. from the form variables using <cfcontent type="application/msword"> and outputing my variables within that.

I am trying to find a way to complete the form, create the Word Doc. and have it uploaded to a folder on my server all at once.

As of now the Word Doc. is simply created, it needs to be stored somewhere online.

Thanks.
TOPICS
Advanced techniques

Views

553

Translate

Translate

Report

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
Community Expert ,
May 21, 2006 May 21, 2006

Copy link to clipboard

Copied

It doesn't have to go into complications like auto-upload. The following code will save the text, table and photo directly to the server as a Word document.

Votes

Translate

Translate

Report

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
Participant ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

Thanks for the response. It does not work becuase I am unfortunately using Coldfusion 4.5

Votes

Translate

Translate

Report

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
Community Expert ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

hmmm. Could you then do it this way? (Come to think of it, it might in fact be a better solution, generally.)

page1.cfm
==========
<cfhttp url=" http://127.0.0.1:8500/staffQuiz/page2.cfm" method="GET" resolveurl="Yes" throwOnError="Yes"/>
<cffile action="WRITE" file="c:\cfusionmx7\wwwroot\staffQuiz\testdocument.doc" output="#cfhttp.filecontent#">

page2.cfm
==========
<cfheader name="Content-Disposition" value="inline; filename=testdocument.doc">
<cfcontent type="application/msword">
<h3>Showbiz Quiz</h3>
<p>
<table border="2">
<tr><th>Name</th><th>Department</th><th>Points</th></tr>
<tr><td>Albert</td><td>Sales</td><td >455</td></tr>
<tr><td>Anne</td><td>IT</td><td>75</td></tr>
<tr><td>David</td><td>Personnel</td><td >120</td></tr>
<tr><td>Fred</td><td>Admin</td><td>88</td></tr>
</table>
</p>
<p><img src="staffPhoto.jpg"></p>
From left to right: David, Albert, Anne, Fred

Votes

Translate

Translate

Report

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
Participant ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

LATEST
Thanks again. I tried the new code and I think I'm getting closer. Now I just have to figure out why I get this error:

The requested file is not ASCII text and can not be rendered.

Votes

Translate

Translate

Report

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
Documentation