Here's what I do- I have a similar situation where I need to keep sets of files that users upload.
I use the file upload control.
In the webhandler, I put a couple of embeds -
In the RenameFile method, in the Data section -
szDirName cstring(256)
... and After the parent I put this -
szDirName=(longpath()&'\web\uploads\'&self.getsessionvalue('curOrg'))
mkdir(szDirName)
Self.SetSessionValue('Curr_FileName',getfilename(p_filename))
and in the HandleFile method, in the Data section -
szDirName cstring(256)
... and I put this after the parent-
!Wait for the file to arrive (the parent begins the transfer)
btime#=clock()
loop
if (clock() - btime#) > 1000 !Adjust this to handle different load times
beep
break
end
if exists(P_Filename)
Break
end
end
szDirName=longpath()&'\web\uploads\'&self.GetSessionValue('CurOrg')
!szDirName can point to anywhere.
self.SetSessionValue('CopiedFileName',getfilename(p_filename))
self.SetSessionValue('ProcessFileName',szDirName)
!I go through a bunch of stuff to create a new filename, but you can use just the p_filename
szDirName = clip(szDirName)&'p_filename')
copy(clip(p_filename),szDirName&' ')
if ~errorcode()
btime#=clock()
loop
if (clock() - btime#) > 500
beep
break
end
if exists(szDirName)
remove(p_filename)
Break
end
end
end
Does this help?
chris