Signature/Camera image not uploading

Use this board to ask questions or have discussions with other Rich Displays users.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Signature/Camera image not uploading

Post by Paul_Ramcharitar »

With the realease of profoundui 4.1.6, I decided to try:

(1) The "pui.uploadSignature" method, to upload a signature as an image from the signature pad widget.

(2) The "pui.capturePhoto" method, to capture and upload photos from the device's camera.

However, the image isn't uploading. I keep getting an alert box that says "undefined", when I try both methods.

I have set my PUIUPLEXIT program to allow uploads.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Signature/Camera image not uploading

Post by Scott Klement »

There was a change to the way errors were communicated starting in PUI 4.1.5.

I suspect you've updated your IBM i server (installed 4.1.6 of ProfoundUI) but are still using the old version (4.1.4 or earlier) in the mobile app.

Inside your assets/www directory (in your phonegap dev environment) you'll see that there's a file called "runtime.js". This is the ProfoundUI runtime. when you upgrade the server, you need to replace that runtime.js with the new version, and re-generate your mobile apps.

You can get the server file from your IFS, it's under
/www/YOUR-HTTP-INSTANCE/htdocs/profoundui/proddata/js

Just copy it into the assets/www directory of your project (replacing the old one) and then re-generate your app. I think it'll solve the problem.

Let me know how that works out.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Signature/Camera image not uploading

Post by jac53 »

Hi Paul:

After you copied the runtime.js Did you issues were fixed?
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Signature/Camera image not uploading

Post by Paul_Ramcharitar »

I had already placed the latest copy of runtime.js (4.1.6) in the assets directory of the app. I did it again just to be sure, but I'm still getting the "undefined" error. Here is my takePicture() function:

Code: Select all

function takePicture() {  // this is called from the display file using the onclick event
  pui.capturePhoto({
    dir: "/www/profoundui/htdocs/profoundui/userdata/images/CustImages",
    fileName: "CSPIC.jpg",  // we're using a hard-coded file name; use the get() API for a dynamic file name
    overwrite: true,
    handler: function(response) {
      if (response.success) pui.click();  // submit the screen on success
      else alert(response.error);  // otherwise, display the error message returned from the API
    }
  });
}
Attachments
Screenshot of my logcat, after I take a photo with the camera
Screenshot of my logcat, after I take a photo with the camera
logcat.PNG (48.25 KiB) Viewed 2504 times
Last edited by Paul_Ramcharitar on Mon Nov 12, 2012 11:26 am, edited 1 time in total.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Signature/Camera image not uploading

Post by jac53 »

Thank you Paul. I feel better now, not being the only one. :)
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Signature/Camera image not uploading

Post by Scott Klement »

Obviously, there's a bug here somehwere... trying to figure it out.

This string (from your log): "{'success':false,'key':'prevented'}" means that the upload was prevented by the exit program -- in other words, the exit program is not setting the "allow" flag to a 1.

But, the runtime.js should be translating that to say "Operation prevented by exit program." for you to see. This must be a bug in the pui.capturePhoto API...
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Signature/Camera image not uploading

Post by Paul_Ramcharitar »

Hi Scott,

The exit program (PUIUPLEXIT) already has: Allow = 1; This is without any conditions.

I was able to test it by uploading an image from my app, to the IFS, using a php script, and the upload was successful.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Signature/Camera image not uploading

Post by Scott Klement »

Paul, the PUIUPLEXIT program is only used by ProfoundUI. So it's used for stuff like the file uploads widget, pui.capturePhoto(), and pui.uploadSignature(). However, a PHP upload would not use the PUIUPLEXIT program. (Unless it's somehow interfacing with ProfoundUI for this?)

The JSON you posted (specifically the 'key': 'prevented') will only occur if the exit program is called successfully, but returns a value side from 1 in the allow parameter.

If you would send us an e-mail at support@profoundlogic.com, we can send you a fix to the error reporting bug as soon as it's available (hopefully later this afternoon) and then you can get a proper error message.
jac53
Experienced User
Posts: 170
Joined: Mon Jul 19, 2010 2:40 pm
First Name: Jorge
Last Name: Cabrera
Company Name: Lennar Corp
Phone: 305-229-6400
Contact:

Re: Signature/Camera image not uploading

Post by jac53 »

I have the same problem as Paul, so I am following his posting.
My PUIUPLEXIT has: Allow = 1 also, so I would appreciate it if the fix it is posted to the forum for the benefit of others like me.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Signature/Camera image not uploading

Post by Scott Klement »

I'll be sure to let you know, Jorge, when a fix is available.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests