mrc logo mrc logo
  • m-Power m-Power
    What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • Solutions Solutions
    What does m-Power build?
    Overview Database Front-Ends Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization Spreadsheets to the web MS Access to the web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs and Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Services Services
    Development Services Training Mentoring
  • About About
    Overview Partners Press Releases Careers Events Contact Blog
  • Support Support
    Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Maintainers
  • Upload Files to Server
Back to Manual

Upload Files to Server

 

One feature of Maintainers is to allow the uploading of files from your client machine to the server. This feature is unique in the fact that it will also add a record to the database, as well as upload the specific file to the server.

To begin, create a maintenance application as you normally would. In "Field Settings", find the field that will serve as the File Name for the uploaded file. In the User Defined Field Control, select the "U". This will tell m-Power to create an upload button next to this field, and when the record is written to the table, write the File Name to this field.

Build your application as you normally would. Before running the application, let's look at the application properties for this program. After you scroll to the bottom, you will see these three options:

The "upload_dir" is the location on the server that this file will be uploaded to. If the folder does not exist, it will be created.

Note: While you must pick a valid drive, this property supports two substitutions for dynamic uploading. First, you can use ${mpower} to automatically select the m-Power folder, which is useful for deployment between development and production. Second, you can use ${FIELD} where FIELD is the name of a field, which can be used to upload a file to a directory dependent upon some form value your end user selects.

The "upload_max_size" is the maximum size, in megabytes, that a file can be in order to be uploaded. If a file is too large, the user will see an error at runtime that they must pick a smaller file.

The "upload_auto_rename" allows you to control the behavior when a file of the same name already exists in the upload_dir. You can either choose to have m-Power auto-rename the file (so file.txt would become file(1).txt) or you can automatically overwrite the existing file.

Make any necessary changes and click "OK".

When I run my application, I see something like this:

Notice the "Browse" button in the Attachment cell. Clicking on "Browse" brings up a view of my local machine. After I select a file, the location will be inserted.

Note: The upload feature is designed only to add files. This feature is not meant to remove files or modify files in any way, other than already discussed.

Error Checking

Below is a list of the common error checking that m-Power will do to ensure that the proper information is being uploaded:

If the file name is too long, this error is displayed:

If a file exceeds the maximum size, this error is displayed:

Editor's Note: The Maximum Size was changed in this example for practicality purposes. The default size is 100 MB.

Standard maintenance rules apply: Key fields must be unique. In addition, the number of characters in the file name can not exceed the length of the File Name field. For instance, if I want to upload the file "Damaged_goods.jpg" to a 15 alpha field, it would be rejected, as "Damaged_goods.jpg" is 17 characters long.

Created: July 9, 2008 | Modified: February 9, 2018

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Excel Record Selections Performance Database Build Process SQL Email Calculations Video Prompt Screens Freemarker Summaries Java Application Properties Parameters Dropdowns App Properties Reports Tomcat Bar Graphs External Objects Retrieval Administration Getting Started Maintainers Graphs Admin Dates mrc-Productivity Series Retrievals DB2 Popular Form Validation m-Painter Bootstrap Templates Report Graph Properties Production RPG Advanced Graphing Compiling Data Dictionary Security Maintainer

See all tags »

michaels, ross & cole, ltd. (mrc)

Privacy Policy Cookie Policy Cookie Settings Notice at Collection Do Not Sell or Share My Personal Information

mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566


© 2024 mrc. All rights reserved.