the error message is:
Oops!
Message ColdFusion could not delete the file C:\ColdFusion8\wwwroot
\newArtea\assets\images\cataloghi\alessia\hires.jpg for an unknown
reason.
my upload method:
<cffunction name="saveImg"
access="public"
output="false"
returntype="ModelGlue.Core.Event">
<cfargument name="event" type="ModelGlue.Core.Event"
required="true" />
<cfset var slidingpath =
beans.settingMgr.getCataloghi() &
arguments.event.getValue("modelloImg")>
<cfif len(trim(arguments.event.getValue('newImg')))>
<cffile action="upload"
destination="#expandPath(slidingPath)#"
nameconflict="overwrite" filefield="newImg" result="upResult"
attributes="normal">
</cfif>
<cfset
arguments.event.setvalue("slide",arguments.event.getValue
("modelloImg"))>
<cfreturn arguments.event />
</cffunction>
my delete method (without cftry block):
<cffunction name="cancellaImg"
access="public"
output="false"
returntype="ModelGlue.Core.Event">
<cfargument name="event" type="ModelGlue.Core.Event"
required="true" />
<cfset var modello =
arguments.event.getValue("modello")>
<cfset var img = arguments.event.getValue("img")>
<cfset var img2delete = beans.settingMgr.getCataloghi()
& modello &
"/" & img>
<cffile action="delete" file="#expandPath(img2delete)#">
<cfset arguments.event.setValue("slide",modello)>
<cfreturn arguments.event />
</cffunction>
thanks and regards
salvatore
On 16 Set, 12:02, Chris Blackwell <[email protected]> wrote:
> What is the full error message when you try to delete and can you show what
> you are doing when you upload the image
>
> 2009/9/16 salvatore fusto <[email protected]>
>
>
>
>
>
> > Ok Kris, you are right.
> > my controller now is:
> > <cffunction name="cancellaImg"
> > access="public"
> > output="false"
> > returntype="ModelGlue.Core.Event">
> > <cfargument name="event" type="ModelGlue.Core.Event"
> > required="true" />
> > <cfset var modello =
> > arguments.event.getValue("modello")>
> > <cfset var img = arguments.event.getValue("img")>
> > <cfset var img2delete =
> > beans.settingMgr.getCataloghi() & modello &
> > "/" & img>
> > <cfset var deletedImgs =
> > beans.settingMgr.getCataloghi() &
> > "deleted" >
> > <cftry>
> > <cffile action="delete"
> > file="#expandPath(img2delete)#">
> > <cfcatch type="any">
> > <cfthrow message="#cfcatch.type#">
> > </cfcatch>
> > </cftry>
> > <cfset arguments.event.setValue("slide",modello)>
> > <cfreturn arguments.event />
> > </cffunction>
>
> > i added a cftry/cfcatch block to see error type, that is application.
> > thank you
> > salvatore
>
> > On 16 Set, 11:02, Chris Blackwell <[email protected]> wrote:
> > > salvatore,
> > > The amount of help we can provide is directly related to the amount of
> > > information and code samples you can give us to look at. Please post
> > your
> > > upload controller method so we can see what you are doing.
>
> > > From what you describe it seems like you are some who leaving a file
> > handle
> > > open on the uploaded image, but without seeing your code i really can't
> > > offer a solution.
>
> > > Chris
>
> > > 2009/9/16 salvatore fusto <[email protected]>
>
> > > > hi,
> > > > i've a simple method of a controller to upload a jpg: doing this
> > > > however i've noted that my jpg remains locked after upload, i.e. i
> > > > cannot delete it, until i reload the framework.
> > > > can i solve?
> > > > regards
> > > > salvatore- Nascondi testo citato
>
> > > - Mostra testo citato -- Nascondi testo citato
>
> - Mostra testo citato -
--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---