Yelled too soon.
The file type filter is working (accept="text/html" or whatever), but not in all browsers as it seems.
And using the WOFileUpload component for getting a directory path may be done by using the WOFileUpload component normally, but extracting the files path by using _javascript_ and just submitting the directory path. This is not very nice, since a file has to be selected anyway, but it works.
Something like:
<html> <head> <title>Return file directory</title> <script language="_javascript_"> function GetDirectory() { strFile = document.MyForm.MyFile.value; intPos = strFile.lastIndexOf("\\"); strDirectory = strFile.substring(0, intPos); alert(strFile + '\n\n' + strDirectory); return false; } </script> </head> <body> <form name="MyForm"> <input type="file" name="MyFile"> <input type="button" value="Get directory" > </form> </body> </html>
>>> "Andri vonAllmen" <email@hidden> Dienstag, 11. August 2009 07:08 >>>
Hi List,
I'm (still) working with WebObjects 5.2 and can't figure out how to do the things mentioned below:
First, a file type filter for th WOFileUpload component is required. I tried to add a "accept" property to its bindings with "text/html" (for example) as value, but that has no effect.
The other thing is, that the same WOFileUpload component shall be able to accept either a file or a directory (optionally I'd use two different components). I tried to add a "type" property with "input" as value, but if doing so, the component is not displayed as a "file selector" anymore.
Any hints are kindly appreciated.
Regards
--- Disclaimer: --------------------------------------------------------- This email and contents is for use only by the intended recipient. If you are not the individual or entity to whom it is addressed, you are hereby formally notified that any use, copying or distribution of this email and attachments, in whole or in part, is strictly prohibited. If you have received this email in error, please notify the sender and delete the message and attachment(s) from your system. Any views, opinions or information, expressed or contained in this email, are those of the sender and not necessarily reflect those of CEDES. To help protect our environment, please avoid printing out this information unnecessarily.
--- Disclaimer:
--------------------------------------------------------- This email
and contents is for use only by the intended recipient. If you are not
the individual or entity to whom it is addressed, you are hereby
formally notified that any use, copying or distribution of this email
and attachments, in whole or in part, is strictly prohibited. If you
have received this email in error, please notify the sender and delete
the message and attachment(s) from your system. Any views, opinions or
information, expressed or contained in this email, are those of the
sender and not necessarily reflect those of CEDES. To help protect our
environment, please avoid printing out this information unnecessarily.
|