I'm in a complex situation here which gives NO ERRORS but doesn't seem to work right.
please help.
My project has several unique sections (where the key=grid)
Every user can upload several images to each group.
everytime he uploads at least 1 file to a new group, I'm assigning him a session array
variable
that is called: "session.my#url.grid#":
<cfif NOT isDefined("session.my#url.grid#")>
<cflock timeout="10" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
<cfset "session.my#url.grid#"=Arraynew(1)>
</cflock>
</cfif>
then I give him the upload form.
after each upload, I'm appending the array with the new file:
<cflock timeout="10" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
<cfset temp=ArrayPrepend(evaluate("session.my#url.grid#"),file.serverfile)>
</cflock>
and now I want to display back the upload form, but with a list of the files he
already uploaded:
first I'm moving the session array into a local variable:
<cfif isDefined("session.my#url.grid#")>
<cflock timeout="10" throwontimeout="Yes" type="READONLY" scope="SESSION">
<cfset a=evaluate("session.my#url.grid#")>
</cflock>
then I'm looping without worrying for locking:
Files that were uploaded to #url.grid#:
<cfloop index="i" from="1" to="#arraylen(a)#">
#a[i]#
</cfloop>
the a array keeps being EMPTY all the time.
I'm checking that with this:
<cfif NOT isDefined("a") or arraylen(a) eq 0>
You haven't uploaded any pictures to #url.grid# yet.
</cfif>
note that I don't want to :
a. query the db everytime to get the list of files that was uploaded.
b. limit the session timout to 1 minute
Thanks,
Michael Lugassy
IT/WEB Specialist
Interactive Music Ltd.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists