Web Connection
Looking for a suggestion on getting a photo from a tablet or phone into a web page
Gravatar is a globally recognized avatar based on your email address. Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Michael B
  All
  Sep 29, 2020 @ 09:00am

Rick,

Any suggestions for snapping a pic and with as few taps as possible getting that image or images into a WWWC web page for the eventual saving into a file on the web server? Consider that the pic will be taken by someone who works in a warehouse from their android or apple device. This particular function will be used to take product pictures at the 'inventory receiving' station.

Thank you in advance.

ps: A third party library recommendation is fine as well.

Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Rick Strahl
  Michael B
  Sep 29, 2020 @ 12:25pm

You don't need anything special. Just use a standard <input type="File" /> control and set the media type to images. When you hit the upload it'll prompt you either to take a picture with the camera or let you pick from your camera roll.

Look at the Web Connection image upload examples and try it from a phone or tablet.

https://west-wind.com/wconnect/

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Michael B
  Michael B
  Sep 29, 2020 @ 01:47pm

Rick - sorry to be vague in the initial post. I was looking for some way to rename the 'choose files' button and I found something that is helpful that I thought I would share. Did not test on IOS yet.

<!-- This will turn on the camera facing YOU -->
<input type="file" accept="image/*" capture="user">

<!-- This will turn on the camera facing YOUR SUBJECT -->
<input type="file" accept="image/*" capture="environment">

Also you can add to the file tag - class="custom-file-input" and then add some style like this to rename the button

 .custom-file-input::-webkit-file-upload-button {
  visibility: hidden;
}
.custom-file-input::before {
  content: 'Attach a picture';
  display: inline-block;
  background: -webkit-linear-gradient(top, #f9f9f9, #e3e3e3);
  border: 1px solid #999;
  border-radius: 3px;
  padding: 5px 8px;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
  cursor: pointer;
  text-shadow: 1px 1px #fff;
  font-weight: 700;
  font-size: 10pt;
}
.custom-file-input:hover::before {
  border-color: black;
}
.custom-file-input:active::before {
  background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}
Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Michael B
  FoxInCloud Support - Thierry N.
  Sep 30, 2020 @ 08:01am

Thanks Thiery,

We are a legacy WWWC shop that has subclassed WWWC. Is there a way to take advantage of what you've built without a major disruption to what we've built?

Gravatar is a globally recognized avatar based on your email address. re: Printing a page loaded with oleie class
  FoxInCloud Support - Thierry N.
  Michael B
  Sep 30, 2020 @ 10:14am

on the same site, you can have your WWWC app. and a FoxInCloud app. sitting side by side, responding to different script-mapped extensions.

Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Rick Strahl
  Michael B
  Sep 30, 2020 @ 08:10pm

@Michael - if you actually looked at the sample you can see that it does that by using an invisible button and overlaying a Bootstrap button on top of the invisible one...

The problem is that the stock file upload button can't be styled much, so you draw the button basically with no visibility (you can't hide it it has to be transparent or otherwise invisible) and then you overlay another button inside of it.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Michael B
  Rick Strahl
  Oct 1, 2020 @ 04:32am

Rick - I did look at the samples (on desktop) and of course I have used this code before in other areas of my app, but when I tried on my phone I missed the 'camera' icon at first glance and just saw as an 'upload file'. I was moving too fast that day.

Also FWIW the 'image upload image carousel' button is not functional at the moment on Android.

Gravatar is a globally recognized avatar based on your email address. re: Looking for a suggestion on getting a photo from a tablet or phone into a web page
  Rick Strahl
  Michael B
  Oct 1, 2020 @ 02:14pm

There are different samples. One of them uses a component, while the others use just plain uploads. I've been getting away from using components and just doing direct uploads. The only time a component really makes sense is if you need to chunk your uploads for very large uploads that need progress info. For most scenarios the plain upload control is just fine and much simpler to manage.

+++ Rick ---

© 1996-2020