Hi Jeff,
I have added images to custom types in the same way they are added to
the dmHtml object. Your custom type just needs to have an array property
to hold the associated images.
As for Brendan's bsPhoto custom type, you need to add a delete method to
remove the files from the server, something similar to:
<cffunction name="delete" access="public" hint="Specific delete method
for bsPhoto. Removes physical files from the server.">
<cfargument name="objectid" required="yes" type="UUID"
hint="Object ID of the object being deleted">
<!--- get object details --->
<cfset stObj = getData(arguments.objectid)>
<!--- delete normal image --->
<cfif len(stObj.Photo)>
<cftry>
<cffile action="delete" file="#stObj.Photo#">
<cfcatch type="any"></cfcatch>
</cftry>
</cfif>
<!--- delete thumbnail image --->
<cfif len(stObj.Thumbnail)>
<cftry>
<cffile action="delete"
file="#stObj.Thumbnail#">
<cfcatch type="any"></cfcatch>
</cftry>
</cfif>
<!--- delete --->
<cfset super.delete(stObj.objectId)>
</cffunction>
--Nathan
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf
>Of Jeff Coughlin
>Sent: Thursday, November 04, 2004 3:33 PM
>To: FarCry Developers
>Subject: [farcry-dev] How do I delete an image that was
>uploaded from a custom type?
>
>I have some custom types that allow the user to upload an
>image. Using similar code found Brendan Sisson's bsPhoto
>custom type walkthrough I have the image resized by ImageJ and
>then saved to a specific web folder. However, if I delete the
>object from the custom type area the image remains. How can I
>tell Farcry to delete the image when deleting the object?
>
>note: I was thinking of changing Brendan's code so that it
>uploaded the image as another object in the image branch, but
>I still wouldn't know how to delete the image when deleting
>the record from the custom type.
>
>It would be great if like dmHTML objects, custom types could
>have images and files (as objects) allowed to be uploaded to them.
>
>---
>You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to
>[EMAIL PROTECTED]
>Aussie Macromedia Developers: http://lists.daemon.com.au/
>
>
---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/