I don't know if I discovered a bug, or I just don't fully understand
system documents commands. The Move Document(src;dest) command is
failing to move and rename a document under some circumstances - I
just don't know exactly what those circumstances are.
I gave up on "file upload" as a technique to get documents to the
database. I opted for an email solution. Without going into a lot of
detail - a mailto link is generated with enough information to
identify the document that should be enclosed (mainly PDFs). A 4D
method is called from Active4D that uses Internet Commands to check
the mail and download the mail and any attachments to a "tmp"
director in the web root. The method then figures out what it has,
moves and possibly renames the document to a "docs" folder that is
just outside the web root. The "docs" folder is a safe documents
folder and is used by two different virtual hosts. In my case, the
document is moved from the tmp directory to the correct sub directory
in docs, but it is not renamed. To take my circumstances out of the
picture, I created a test case method in the Active4D demo database.
$fromfile := "/Macintosh HD/Users/salex/Desktop/Demo/web/tmp/foo.txt"
$toFile := "/Macintosh HD/Users/salex/Desktop/Demo/docs/eforms/200608/
foobar.txt"
$af := test path name($fromFile)
$at := test path name($toFile)
if($at = 1) // file exits, delete it and create new version
delete document($toFile)
end if
move document($fromFile;$toFile)
$atx := test path name($toFile)
a4d.debug.dump locals
In the Demo, I set up the safe documents folder, created the sub
directory structure, and allowed the test method to be executed
outside of fusebox. When running this, "foo.txt" gets moved, but does
not get renamed to "foobar.text". I have discovered that I can rename
it in two step, one move document command to move it and another to
rename it. My initial test seemed to work if I just moved the renamed
the document to the root level of the of the docs folder - it failed
when moved to sub directories. I'll file a bug report if someone can
verify that this is in fact a bug and not a misunderstanding on my part.
Steve Alex
Mac OS X 10.4.7
4D 2003.latest
Active4D 4.0.3 [Mac/Carbon, release, 4D, Client]
P.S to Aparajita. It didn't get posted the other day because my 3
month old MacBook started getting SSS (Sudden Shutdown Syndrome) and
I sent it from another system with the wrong email name/alias.
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/