Skip to main content

MVS Toolkit and file upload

  • March 2, 2022
  • 9 replies
  • 0 views

Chris Wolcz
Forum|alt.badge.img
Hello,

We plan to use the MVS Toolkit for data entry form on a phone app. How would you go about uploading a photo from your mobile app to a server?
The picture should be stored on a server as JPG file. The path or URL for the picture should be stored on D3.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------

9 replies

Forum|alt.badge.img+1
Hello,

We plan to use the MVS Toolkit for data entry form on a phone app. How would you go about uploading a photo from your mobile app to a server?
The picture should be stored on a server as JPG file. The path or URL for the picture should be stored on D3.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------
Or you can convert the image to base64 and store insied D3

------------------------------
Alberto Leal
System Analyst
Millano Distribuidora de Auto Pecas Ltda
Varzea Grande MT BR
------------------------------

Doug Averch
Forum|alt.badge.img
  • Participating Frequently
  • March 2, 2022
Hello,

We plan to use the MVS Toolkit for data entry form on a phone app. How would you go about uploading a photo from your mobile app to a server?
The picture should be stored on a server as JPG file. The path or URL for the picture should be stored on D3.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------
I have simplified the code of what you need in HTML and JavaScript. There are other parts but this is the basic stuff.

HTML code:
<canvas id="canvasContent"></canvas>

JavaScript Code:
const canvas = document.getElementById("canvasContent");
const dataUrl = canvas.toDataURL("image/jpeg", 0.5);
// Write dataUrl to the database

------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------

Chris Wolcz
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • March 4, 2022
I have simplified the code of what you need in HTML and JavaScript. There are other parts but this is the basic stuff.

HTML code:
<canvas id="canvasContent"></canvas>

JavaScript Code:
const canvas = document.getElementById("canvasContent");
const dataUrl = canvas.toDataURL("image/jpeg", 0.5);
// Write dataUrl to the database

------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------
Thank you for your answers. I need the uploaded picture to be available for e.g.  a webpage to display.  That's why I wanted to only store URL to the picture in the D3.
My understanding is that MVS Toolkit, even though it is a web server, cannot serve images stored in some Windows folder (and neither can save images to a folder).

We have an IIS server but I don't know how to use it for that purpose (security/upload service of some kind etc.). I did look into Google Storage as I had it working on a different project but it is giving me grief right now. :)

Any suggestions how to do it easily would be appreciated.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------

Forum|alt.badge.img+1
Thank you for your answers. I need the uploaded picture to be available for e.g.  a webpage to display.  That's why I wanted to only store URL to the picture in the D3.
My understanding is that MVS Toolkit, even though it is a web server, cannot serve images stored in some Windows folder (and neither can save images to a folder).

We have an IIS server but I don't know how to use it for that purpose (security/upload service of some kind etc.). I did look into Google Storage as I had it working on a different project but it is giving me grief right now. :)

Any suggestions how to do it easily would be appreciated.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------

Hy Crhis...

yes with MSV you can do that your web application when upload the image... you convert to base64 before send to MVS rest point

then will be saved in d3, when the file is retrived from d3 will return the base64 string

and in your web page you do something like this:

<!DOCTYPE html>
<html>
  <head>
    <title>Display Image</title>
  </head>
  <body>
    <img style='display:block; width:100px;height:100px;' id='base64image'
       src='data:image/jpeg;base64, LzlqLzRBQ... <!-- Base64 data -->' />
  </body>
</html>


------------------------------
Alberto Leal
System Analyst
Millano Distribuidora de Auto Pecas Ltda
Varzea Grande MT BR
------------------------------

Chris Wolcz
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • March 7, 2022

Hy Crhis...

yes with MSV you can do that your web application when upload the image... you convert to base64 before send to MVS rest point

then will be saved in d3, when the file is retrived from d3 will return the base64 string

and in your web page you do something like this:

<!DOCTYPE html>
<html>
  <head>
    <title>Display Image</title>
  </head>
  <body>
    <img style='display:block; width:100px;height:100px;' id='base64image'
       src='data:image/jpeg;base64, LzlqLzRBQ... <!-- Base64 data -->' />
  </body>
</html>


------------------------------
Alberto Leal
System Analyst
Millano Distribuidora de Auto Pecas Ltda
Varzea Grande MT BR
------------------------------
Doug and Alberto,

Thank you for your answers. This is a great idea. I guess, I would need a javaScript to get the data for the img tag.
I am wondering how well D3/MVS is going to handle strings that are few million characters long.
The other concern is that the image will be a part of daily D3 save. Clients may not like bigger saves that take longer to finish.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------

Forum|alt.badge.img+1
Doug and Alberto,

Thank you for your answers. This is a great idea. I guess, I would need a javaScript to get the data for the img tag.
I am wondering how well D3/MVS is going to handle strings that are few million characters long.
The other concern is that the image will be a part of daily D3 save. Clients may not like bigger saves that take longer to finish.

Thanks,

Chris

------------------------------
Chris Wolcz
Senior Software Developer
Execontrol Global Solutions
Clifton Park NY US
------------------------------

the base64 has some "compression" in the string.. so the string will not be the same size as the original file

about MSV handle a big string i have no ideia


backups are always big hahha... my gerenates 62 Files



------------------------------
Alberto Leal
System Analyst
Millano Distribuidora de Auto Pecas Ltda
Varzea Grande MT BR
------------------------------

Doug Averch
Forum|alt.badge.img
  • Participating Frequently
  • March 7, 2022

the base64 has some "compression" in the string.. so the string will not be the same size as the original file

about MSV handle a big string i have no ideia


backups are always big hahha... my gerenates 62 Files



------------------------------
Alberto Leal
System Analyst
Millano Distribuidora de Auto Pecas Ltda
Varzea Grande MT BR
------------------------------
We download pictures from our driver accident application that the driver takes with his/her smartphone.  They are stored on the phone and transferred to Universe/Unidata. If D3 has a directory or type 19 storage then you can store them individually. However, we just store them in a hashed file. It works. The web server has no trouble uploading all of the pictures when called upon.

------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------

Bill Brutzman
  • Participating Frequently
  • March 8, 2022
We download pictures from our driver accident application that the driver takes with his/her smartphone.  They are stored on the phone and transferred to Universe/Unidata. If D3 has a directory or type 19 storage then you can store them individually. However, we just store them in a hashed file. It works. The web server has no trouble uploading all of the pictures when called upon.

------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------
Doug:

The photo of the skier rocks.   Is that you?

--Bill

------------------------------
Bill Brutzman
IT Manager
Hk Metalcraft Manufacturing Corporation
Lodi NJ US
------------------------------

Doug Averch
Forum|alt.badge.img
  • Participating Frequently
  • March 9, 2022
Doug:

The photo of the skier rocks.   Is that you?

--Bill

------------------------------
Bill Brutzman
IT Manager
Hk Metalcraft Manufacturing Corporation
Lodi NJ US
------------------------------
No, Bill that is a stock photo. I do ski and have for many many years.

------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------