Skip to main content
Participant
July 23, 2012
Question

How To Access Uploaded File Data Prior To CFFILE

  • July 23, 2012
  • 2 replies
  • 716 views

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.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
July 29, 2012

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.>

Inspiring
July 24, 2012

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