Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 16 FEB 2022 03:00:30AM Barry Stevens wrote:

OI64

Allow O4W access to mobile phone camera and images - how could you implement that function assuming that O4W can run HTML5

Can anything here be implemented

or this javascript?

<input type="file" accept="image/*;capture=camera">

Be kind, I am a newbie :biggrin:


At 16 FEB 2022 07:28AM bshumsky wrote:

OI64

Allow O4W access to mobile phone camera and images - how could you implement that function assuming that O4W can run HTML5

Can anything here be implemented

or this javascript?

<input type="file" accept="image/*;capture=camera">

Be kind, I am a newbie :biggrin:

O4W is based on jQuery and jQuery Mobile, which is HTML5 "friendly".

Most (all?) of the O4W APIs allow you to specify "options" that modify the basic functionality. In this case, you'd have an O4WUPLOADBOX, and use the O4WUPLOADBOXOPTIONS to specify the "accept" information. So you would have code that looks something like this:

DESTN_NAME = DATE() : TIME() : ".$"

O4WUPLOADBOX("", "D:\DOWNLOADIMAGES\": DESTN_NAME, "","SOMEIMAGE","SOMEIMAGE", O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) )

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.


At 16 FEB 2022 03:59PM Barry Stevens wrote:

OI64

Allow O4W access to mobile phone camera and images - how could you implement that function assuming that O4W can run HTML5

Can anything here be implemented

or this javascript?

<input type="file" accept="image/*;capture=camera">

Be kind, I am a newbie :biggrin:

O4W is based on jQuery and jQuery Mobile, which is HTML5 "friendly".

Most (all?) of the O4W APIs allow you to specify "options" that modify the basic functionality. In this case, you'd have an O4WUPLOADBOX, and use the O4WUPLOADBOXOPTIONS to specify the "accept" information. So you would have code that looks something like this:

DESTN_NAME = DATE() : TIME() : ".$"

O4WUPLOADBOX("", "D:\DOWNLOADIMAGES\": DESTN_NAME, "","SOMEIMAGE","SOMEIMAGE", O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) )

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.

Looking at this reference

Would setting O4WUPLOADBOXOPTIONS to:

to take a photo and capture it

O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* )

get user to select already taken photos O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) Or Does this appear to have a built in function to ask if want to select a photo or take a photo of what user is looking at. O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* ) </QUOTE> —- === At 16 FEB 2022 04:07PM Barry Stevens wrote: === <QUOTE> <QUOTE> <QUOTE> <QUOTE>OI64 Allow O4W access to mobile phone camera and images - how could you implement that function assuming that O4W can run HTML5 Can anything here be implemented or this javascript? <input type="file" accept="image/*;capture=camera"> Be kind, I am a newbie :biggrin: </QUOTE> O4W is based on jQuery and jQuery Mobile, which is HTML5 "friendly". Most (all?) of the O4W APIs allow you to specify "options" that modify the basic functionality. In this case, you'd have an O4WUPLOADBOX, and use the O4WUPLOADBOXOPTIONS to specify the "accept" information. So you would have code that looks something like this: DESTN_NAME = DATE() : TIME() : ".$" O4WUPLOADBOX("", "D:\DOWNLOADIMAGES\": DESTN_NAME, "","SOMEIMAGE","SOMEIMAGE", O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) ) Hope that helps, - Bryan Shumsky Revelation Software, Inc.</QUOTE> Looking at this reference Would setting O4WUPLOADBOXOPTIONS to: to take a photo and capture it O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* ) get user to select already taken photos

O4WUPLOADBOXOPTIONS("","image/*;capture=camera" )

Or Does this appear to have a built in function to ask if want to select a photo or take a photo of what user is looking at.

O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* )

I cant find O4WUPLOADBOXOPTIONS in the online help O4W command list

</QUOTE>


At 06 APR 2023 06:21PM Barry Stevens wrote:

OI64

Allow O4W access to mobile phone camera and images - how could you implement that function assuming that O4W can run HTML5

Can anything here be implemented

or this javascript?

<input type="file" accept="image/*;capture=camera">

Be kind, I am a newbie :biggrin:

O4W is based on jQuery and jQuery Mobile, which is HTML5 "friendly".

Most (all?) of the O4W APIs allow you to specify "options" that modify the basic functionality. In this case, you'd have an O4WUPLOADBOX, and use the O4WUPLOADBOXOPTIONS to specify the "accept" information. So you would have code that looks something like this:

DESTN_NAME = DATE() : TIME() : ".$"

O4WUPLOADBOX("", "D:\DOWNLOADIMAGES\": DESTN_NAME, "","SOMEIMAGE","SOMEIMAGE", O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) )

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.

Looking at this reference

Would setting O4WUPLOADBOXOPTIONS to:

to take a photo and capture it

O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* )

get user to select already taken photos O4WUPLOADBOXOPTIONS("","image/*;capture=camera" ) Or Does this appear to have a built in function to ask if want to select a photo or take a photo of what user is looking at. O4WUPLOADBOXOPTIONS("","id=imageFile;capture=environment;accept=image/* ) </QUOTE> I cant find O4WUPLOADBOXOPTIONS in the online help O4W command list</QUOTE> There is still no 4WUPLOADBOXOPTIONS in the help. Is there now a better way to handle photos in OI10 latest O4W </QUOTE> —- === At 08 APR 2023 09:43AM bshumsky wrote: === <QUOTE>Hi, Barry. I believe this is still the way to do it in O4W. The O4WUploadBoxOptions has the following API: function O4WUploadBoxOptions(bSkip, acceptTypes, bNoDelete) where: bSkip is a flag, 0/1, whether or not to skip sending this file during form events like "lostfocus"; acceptTypes is a list of the types of uploads to accept; bNoDelete is a flag, 0/1, whether or not to delete the OS file after uploading it to O4W You're interested in the "accept" parameter, which lists the type(s) of file(s) that the "upload" control will accept. As described in the Mozilla documentation: <code> accept The accept attribute value is a string that defines the file types the file input should accept. This string is a comma-separated list of unique file type specifiers. Because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of a given format. For instance, there are a number of ways Microsoft Word files can be identified, so a site that accepts Word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" /> capture The capture attribute value is a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. A value of user indicates that the user-facing camera and/or microphone should be used. A value of environment specifies that the outward-facing camera and/or microphone should be used. If this attribute is missing, the user agent is free to decide on its own what to do. If the requested facing mode isn't available, the user agent may fall back to its preferred default mode. Note: capture was previously a Boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. multiple When the multiple Boolean attribute is specified, the file input allows the user to select more than one file. </code> The O4WUploadBoxOptions will take the value of the "accept" parameter and convert it into the syntax used by the file upload box; it expects to ONLY have the list of the file types and (if needed) the capture string, not the "accept=" prefix or any other things (like "id=" ) . Hope that helps, - Bryan Shumsky Revelation Software, Inc. </QUOTE> —- === At 09 APR 2023 06:58PM Barry Stevens wrote: === <QUOTE> <QUOTE>Hi, Barry. I believe this is still the way to do it in O4W. The O4WUploadBoxOptions has the following API: function O4WUploadBoxOptions(bSkip, acceptTypes, bNoDelete) where: bSkip is a flag, 0/1, whether or not to skip sending this file during form events like "lostfocus"; acceptTypes is a list of the types of uploads to accept; bNoDelete is a flag, 0/1, whether or not to delete the OS file after uploading it to O4W You're interested in the "accept" parameter, which lists the type(s) of file(s) that the "upload" control will accept. As described in the Mozilla documentation: <code> accept The accept attribute value is a string that defines the file types the file input should accept. This string is a comma-separated list of unique file type specifiers. Because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of a given format. For instance, there are a number of ways Microsoft Word files can be identified, so a site that accepts Word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" /> capture The capture attribute value is a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. A value of user indicates that the user-facing camera and/or microphone should be used. A value of environment specifies that the outward-facing camera and/or microphone should be used. If this attribute is missing, the user agent is free to decide on its own what to do. If the requested facing mode isn't available, the user agent may fall back to its preferred default mode. Note: capture was previously a Boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. multiple When the multiple Boolean attribute is specified, the file input allows the user to select more than one file. </code> The O4WUploadBoxOptions will take the value of the "accept" parameter and convert it into the syntax used by the file upload box; it expects to ONLY have the list of the file types and (if needed) the capture string, not the "accept=" prefix or any other things (like "id=" ) . Hope that helps, - Bryan Shumsky Revelation Software, Inc.</QUOTE> Ok, thanks. So I assume this documentation is still yet to be published. </QUOTE> View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/8e253597b384744bac74f0f034e93e66.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1