kpa
Posts: 31
|
| Posted: 09/27/2011, 4:03 AM |
|
I have a very annoying problem that I'm hoping somone on the list can help me with please.
The scripting language is ColdFusion but I don't believe this is a CFML issue so I've posted this in the General area - hope thast OK 
I have a CCS form that allows the user to upload an image to an image gallery. I have some custom code in the "After Process File" event that creates two additional versions of the image - that script works perfectly well when a new image is uploaded.
However, when the user deletes the image i.e. checks the Delete check box on the File Upload component and hits Submit, I want to delete the other two images as well - that makes sense and sounds simple - NOT.
I have placed code in "Before Delete File" and also tried "After Delete File" and those two images simply don't get deleted. What I did then was place a simple bit of script in both events to send me a simple plain text email when those events got executed. I don't get the emails.
This suggests that on delete those 2 events don't get touched.
Any clues please?
_________________
++++++
kpa
++++++ |
 |
 |
E43509
Posts: 283
|
| Posted: 09/27/2011, 5:49 AM |
|
I like your idea of sending an email if those sections get executed.
You can also try this to give you more insight.
Usually there is a CFIF before your custom code testing if fileuploaddelete, strOperation, state are true. Put in a <cfdump var="#strOperatoin#"> <cfabort> before that logic runs so you can see what the values are. A little primative troubleshooting will help you get some info as to the behavior.
If you have a simplified version of the project, I may be able to look at it if you can provide.
|
 |
 |
kpa
Posts: 31
|
| Posted: 09/28/2011, 3:48 AM |
|
Thank you for your advice 
I'm afraid things just get weirder. I tried your suggestion in both "Before Delete File" and "After Delete File" (with appropriate adjustments to variables of course) and the code didn't execute.
I also tried 2 scenarios - I tried checking the delete box on the file upload component and then hitting submit (which correctly deletes the image recorded in the database) and I also tried just deleting the record outright.
Same result - it deletes the recorded image but not the additional files.
It's very frustrating
_________________
++++++
kpa
++++++ |
 |
 |
kpa
Posts: 31
|
| Posted: 09/28/2011, 4:31 AM |
|
RESOLVED.
But it only gets weirder. When I added Custom Code to the "Before Delete File" and "After Delete File" events and clicked on that event it took me to a particular place in the code which corresponded to an embed point for Custom Code for those events - hope that makes sense I figured that's where I should place my code.
I poured over the code trying to work out line for line what was happening here and noticed corresponding embed points for these events much further down the page. When I added the code at one of those points it worked a treat.
_________________
++++++
kpa
++++++ |
 |
 |
datadoit
|
| Posted: 09/28/2011, 6:24 AM |
|
It's possible this may be ColdFusion specific. Have you tossed this off
to support?
|
|
|
 |