Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:06:03+00:00 2026-05-27T21:06:03+00:00

What am I doing wrong? fileUpload.cfm <cfcomponent name=fileAttachment hint=This is the File Attachment Object>

  • 0

What am I doing wrong?

fileUpload.cfm

<cfcomponent name="fileAttachment" hint="This is the File Attachment Object">

    <cffunction name="uploadFile" access="public" output="no" returntype="string">
        <cfargument name="fileToUpload" type="string" required="no">
        <cfargument name="pDsn" required="no" type="string">
        <cfset var cffile = "">
        <cffile action="upload" destination="D:\apache\htdocs\abc\uploads" filefield="#ARGUMENTS.fileToUpload#" nameconflict="makeunique">
        <cfreturn cffile.clientFile />
    </cffunction>

</cfcomponent>

test_fileUpload.cfm

<form action="fileUpload.cfm" enctype="multipart/form-data" method="post">
    <input type="file" name="fileToUpload"><br/>
    <input type="submit">
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:06:03+00:00Added an answer on May 27, 2026 at 9:06 pm

    This line:

    <cffile action="upload" destination="D:\apache\htdocs\abc\uploads" filefield="#ARGUMENTS.fileToUpload#" nameconflict="makeunique">
    

    The filefield attribute wants the name of the form field that will hold the uploaded file. You’re on the right track, but unfortunately, that’s not what the value of #ARGUMENTS.fileToUpload# is, presently–based on your construction, it holds a reference to the actual file itself.

    Add a new hidden field to your form:

    <input type="hidden" name="nameOfField" value="fileToUpload">
    

    Then, pass FORM.nameOfField to your uploadFile() method as the first parameter. CFFILE will take care of the rest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What am I doing wrong? This is the .h file: #import <UIKit/UIKit.h> #import <sqlite3.h>
What am I doing wrong with this: $sql = SELECT * FROM content WHERE
What am I doing wrong to get this error? replacements = {} replacements[**] =
What am I doing wrong in this HTML code: <html> <head> </head> <body> <div
What am I doing wrong with my full text search? If this code Select
What am I doing wrong with this shell script? I want to create a
Where am i doing wrong? This is the normal print preview: But I want
What am I doing wrong with this Mootools toggle? <script type="text/javascript"> $(document).ready(function(){ $("#trigger").click(function ()
What im doing wrong this time? The following code always returns 4 bytes only,
What am I doing wrong with this XPath query? Within the feed tag, there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.