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]

Reply via email to