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.
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.
Copy link to clipboard
Copied
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.>