• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SOLVED / Antw: WOFileUpload - set filter for file type / select a directory(instead of a file)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED / Antw: WOFileUpload - set filter for file type / select a directory(instead of a file)


  • Subject: SOLVED / Antw: WOFileUpload - set filter for file type / select a directory(instead of a file)
  • From: "Andri vonAllmen" <email@hidden>
  • Date: Tue, 11 Aug 2009 08:19:53 +0200

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>
Found on: http://forums.aspfree.com/web-layout-43/browse-button-in-html-for-directory-selection-alone-not-file-36330.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.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >WOFileUpload - set filter for file type / select a directory (instead of a file) (From: "Andri vonAllmen" <email@hidden>)

  • Prev by Date: WOFileUpload - set filter for file type / select a directory (instead of a file)
  • Next by Date: Making an important design decision
  • Next by thread: Re: WOMessage and headers + userinfo
  • Index(es):
    • Date
    • Thread