Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfdirectory in mx

Status
Not open for further replies.

Lotruth

Programmer
May 2, 2001
133
US
<cfif button is &quot;download&quot;>
<cfif file is &quot;public&quot;><cfset filePath = &quot;c:\Inetpub\<cfelse><cfset filePath = &quot;c:\Inetpub\<cfheader name=&quot;Content-Disposition&quot; value=&quot;attachment; filename=#getFileFromPath(filePath)#&quot;>
<cfcontent file=&quot;#filePath#&quot; type=&quot;application/octet-stream&quot;>
<cfabort>
</cfif>

Once again, here is a block of code that was fine in 4.5, but doesn't work in MX. Honestly, I don't see the advantage to upgrading. Anyway, I have created a button called upload. When it is submitted, it runs this code which should save to either the public file or the file for whichever projectcode was sent. Unfortunately, the file is always saved in the projectcode=41 folder regardedless of which projectcode I send. Any suggestions? Thanks.
 
The first thing that strikes me is that the variable file is a structure in CFMX, and when I run this on our CF 6.1 server it throws an error saying &quot;Complex object types cannot be converted to simple values&quot;.

Try changing the name of the variable to fileType or something like that.

Try doing an output of the Form.ProjectCode variable and see what is being passed from your form, the code looks ok to me.

Hope this helps!

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top