Hi Daniel,
I recall having the same problem a while back. I trolled around and
found some javascript that would remove all but the filename (work from
the end of the string until you find the first '\' kind of thing).
Its pretty dodgy but then again, so's IE!!
If you get stuck I'll see if I can dredge up the code.
Regards,
Tony
Daniel Hertz wrote:
The following file upload flowscript which works great in Mozilla, but
not at all in Internet Explorer (IE includes the entire path instead
of just the filename, e.g. filename = "filename.jpg"; but IE sends
"Z:/my/path/to/filename.jpg").
I tried getName(), but couldn't get it to work. Any suggestions?
Thanks! Daniel.
== Flowscript ==
[SNIP]
cocoon.sendPage("upload",
{
filename:
form.lookupWidget("upload").getValue().getHeaders().get("filename").toLowerCase()
}
);
function handleUpload(form) {
[SNIP]
var fileName =
form.lookupWidget("upload").getValue().getHeaders().get("filename").toLowerCase();
var uploadWidget = form.lookupWidget("upload");
if (uploadWidget.getValue() != null) {
// test if user directory exists, if not, create it
if (!userDir.exists())
{
userDir.mkdirs();
}
uploadWidget.getValue().copyToFile(userDir + java.io.File.separator
+ fileName);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Tony Edwards
¯¯¯¯¯¯¯¯¯¯¯¯
Analyst/Programmer
Dip Teach PE
Dip Comp. Studies
p: 02 4941 9400
f: 02 4941 9499
--
This email is from Civica Pty Limited and it, together with
any attachments, is confidential to the intended recipient(s)
and the contents may be legally privileged or contain
proprietary and private information. It is intended solely
for the person to whom it is addressed. If you are not an
intended recipient, you may not review, copy or distribute
this email. If received in error, please notify the sender
and delete the message from your system immediately. Any
views or opinions expressed in this email and any files
transmitted with it are those of the author only and may
not necessarily reflect the views of Civica and do not create
any legally binding rights or obligations whatsoever. Unless
otherwise pre-agreed by exchange of hard copy documents
signed by duly authorised representatives, contracts may not
be concluded on behalf of Civica by email. Please note that
neither Civica nor the sender accepts any responsibility for
any viruses and it is your responsibility to scan the email
and the attachments (if any). All email received and sent by
Civica may be monitored to protect the business interests of
Civica.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]