hefterr
asked on
Image File Upload to ColdFusion Server
Hi,
I have a page that will upload images using something similar to this :
I do have a few other associated fields that are validated in this process. In this example I used a required field "marketComment".
If I need to redisplay the page because of an error (say the text field contained invalid characters), I can redisplay the contents of the text field, but I don't seem to be able to redisplay the "chosen file" to upload. The form field (form.fileUpload) only contains the location of the uploaded file on the CF server.
Is there a way to do this? Or is this a Web security issue?
Thanks,
hefterr
I have a page that will upload images using something similar to this :
<cfif isDefined("fileUpload")>
<cffile action="upload"
fileField="fileUpload"
destination="C:\docs">
<p>Thankyou, your file has been uploaded.</p>
</cfif>
<form enctype="multipart/form-data" method="post">
<input type="file" name="fileUpload" /><br />
<input type=text name="marketComment">
<input type="submit" value="Upload File" />
</form>
I do have a few other associated fields that are validated in this process. In this example I used a required field "marketComment".
If I need to redisplay the page because of an error (say the text field contained invalid characters), I can redisplay the contents of the text field, but I don't seem to be able to redisplay the "chosen file" to upload. The form field (form.fileUpload) only contains the location of the uploaded file on the CF server.
Is there a way to do this? Or is this a Web security issue?
Thanks,
hefterr
ASKER
Hi RickEpnet,
I was still wondering about my original question. My boss doesn't like the popup edit messages. We format our own.
hefterr
I was still wondering about my original question. My boss doesn't like the popup edit messages. We format our own.
hefterr
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the alternative ideas.
Here is an example of a validation cfform.
<cfform action="unitedit.cfm" method="post" name="editatm" preloader="no">
<cfinput type="text" name="Account" message="Account Number is Required" required="yes" style="width: 100px;"maxlength="50">
<cfinput type="text" name="UNIT_ID" message="Unit ID is Required" required="yes" style="width: 100px;" maxlength="50">
</cfform>