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

How To Access Uploaded File Data Prior To CFFILE

New Here ,
Jul 23, 2012 Jul 23, 2012

Copy link to clipboard

Copied

Hi:

Can anyone say why #GetHttpRequestData().content# is empty when I upload files using the conventional input type="file" and form method="post" enctype="multipart/form-data" HTML?

My goal is to inspect the binary data before using cffile action="upload". Is there a way to do this through CF or perhaps Java? Thanks.

TOPICS
Advanced techniques

Views

677

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
LEGEND ,
Jul 23, 2012 Jul 23, 2012

Copy link to clipboard

Copied

You can write an active x control to do it, but dollars to donuts you'll be foiled by the user's browser.

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 ,
Jul 29, 2012 Jul 29, 2012

Copy link to clipboard

Copied

LATEST

Supposing the form field is <input type="file" name="myUpload">, then you could simply intercept the uploaded binary like this:

<!--- We are in the upload form's action page --->

<cffile action="read" file="#form.myUpload#" variable="binaryData">

<!--- Dump the binary data --->

<cfdump var="#binaryData#">

<cffile action = "upload"

    fileField = "myUpload"

    destination = ... etc.>

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