Today, I want to show you an underutilized feature of m-Power: The “Upload Files” function. This m-Power feature allows you and your end-users to easily upload files from the local device (PC, Tablet, or Mobile device) directly to the m-Power server. While m-Power maintenance applications have long provided the functionality to upload files and photos, m-Power’s new mobile applications allow for this feature to be much more powerful. Imagine giving your user base the ability to take a simple snap shot and easily submit that file to your servers directly from their mobile device, all without needing to download and install a single application!
In this example, users can take a picture from their mobile device and then upload it along with their current location (with the help of HTML5 geolocation). The photo and location are then plotted on a Google map.
Adding this upload functionality to your web applications couldn’t be easier with m-power.
First, your application must be built over a table with a field that can store the file name being uploaded. Once you have created your maintenance application over this table, proceed into Field Settings. Set the user defined drop down to “U” (for Upload) for the file name field (in this case UPLDPHOTO1).
After compiling your maintenance application, there are no additional steps required to implement the upload functionality. Run your application on your mobile device and add a new record. You will notice the “Choose File” button.
After you have selected the photo and filled out the remaining fields in your maintenance application, press accept on the maintenance screen. Congratulations, your photo has been uploaded to the server!
Once the photo has been uploaded, you may want to view it in your application. To do this, you can add an image to your app via m-Painter. Open m-Painter and select the Insert Image button from the toolbar. In the URL field, enter the path to the photo’s upload directory followed by the name of the field that contains the file name:
Note: Ignore the red “X” listed in preview — The field name is not known in m-Painter so no preview can render. However, at run-time the image will display properly.