Skip navigation
i69alot
Currently Being Moderated

How To Access Uploaded File Data Prior To CFFILE

Jul 23, 2012 2:51 PM

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.

 

 
Replies
  • Currently Being Moderated
    Jul 23, 2012 5:44 PM   in reply to i69alot

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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 29, 2012 8:07 AM   in reply to i69alot

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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points