PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Control in a dynamic or static page
  • Creating an Upload control
  • Control characteristics
  • Notes
  • Multi-file Upload control in AWP
  • Various
  • Maximum size of files to upload
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview

Control in a dynamic or static page

The Upload control is used to upload files on the Web server.
Several Upload controls are available:
  • Upload control used to upload a single file. This type of control is an advanced control that can be used immediately. It includes several controls (that can be deleted if necessary):
    • Static
    • Progress bar
    • Upload button ("Send" button).
  • Upload control used to upload a set of files. This type of control is an advanced control that can be used immediately. It includes several controls (that can be deleted if necessary):
    • List of files to upload
    • Progress bar (found in a popup)
    • Send, Delete and Clear buttons
    • Upload button ("Add" button).
Versions 17 and later
The Upload controls directly manage the Drag and Drop of files from the explorer (if the browser supports the HTML 5 standard). See Handling an Upload control by programming for more details.
New in version 17
The Upload controls directly manage the Drag and Drop of files from the explorer (if the browser supports the HTML 5 standard). See Handling an Upload control by programming for more details.
The Upload controls directly manage the Drag and Drop of files from the explorer (if the browser supports the HTML 5 standard). See Handling an Upload control by programming for more details.
Note: The Upload edit control is kept for backward compatibility. See File upload for more details.
WEBDEV proposes an advanced Upload control that can be used immediately. It includes several controls (that can be deleted if necessary):
  • Looper used to manage the files to upload. This looper is used to specify the file characteristics, to display a progress bar during the upload and to propose a button used to delete the file from the list if necessary.
  • Caption indicating where the files to upload will be dropped.
  • "Add" button used to add the files.
  • "Send" button to start the file upload.
This control can be used in singlefile mode or in multifile mode.
The Upload control directly manages the Drag and Drop of files from the explorer (if the browser supports the HTML 5 standard). See Handling an Upload control by programming for more details.
Notes:
  • Versions 22 and later
    In the earlier versions (before version 22), WEBDEV proposed two preset Upload controls (control used to upload a single file and control used to upload several files).
    • These controls are still operating in version 22 and later. The only difference with the control proposed in version 22 is the composition of the control (a looper in version 22 and later) and its interface.
    • These controls propose the generation in HTML 5 mode in version 22 (new feature of version 22, see Control characteristics).
    New in version 22
    In the earlier versions (before version 22), WEBDEV proposed two preset Upload controls (control used to upload a single file and control used to upload several files).
    • These controls are still operating in version 22 and later. The only difference with the control proposed in version 22 is the composition of the control (a looper in version 22 and later) and its interface.
    • These controls propose the generation in HTML 5 mode in version 22 (new feature of version 22, see Control characteristics).
    In the earlier versions (before version 22), WEBDEV proposed two preset Upload controls (control used to upload a single file and control used to upload several files).
    • These controls are still operating in version 22 and later. The only difference with the control proposed in version 22 is the composition of the control (a looper in version 22 and later) and its interface.
    • These controls propose the generation in HTML 5 mode in version 22 (new feature of version 22, see Control characteristics).
  • The Upload edit control is kept for backward compatibility. See File upload for more details.
  • Versions 22 and later
    The preset control proposed for the upload is an asynchronous control: You still can continue to use the current site without being locked by the upload.
    New in version 22
    The preset control proposed for the upload is an asynchronous control: You still can continue to use the current site without being locked by the upload.
    The preset control proposed for the upload is an asynchronous control: You still can continue to use the current site without being locked by the upload.

Creating an Upload control

To create an Upload control:
  1. In the page editor, click the arrow found on the right of Icon (or select "Insert .. Control .. Upload control").
  2. In the list that is opened, select the type of Upload control to create.
  3. Click the position where the control will be created in the page. The control appears in the page.
To create an Upload control:
  1. In the page editor, on the "Creation" pane, in the "Usual controls" group, expand "Button".
  2. In the list that is opened, select the type of Upload control to create:
    • Send a single file.
    • Send several files.
    In the list that is opened, select the control type "File upload".
  3. Click the position where the control will be created in the page. The control appears in the page.
To display the control characteristics, select "Description" from the popup menu of Upload control ("Send" or "Add" button).
The WLanguage code for upload management is found in the processes associated with the Upload control. This code can be modified according to your requirements.
Important: The "Receiving the uploaded files" process must be modified before deploying the site. This process contains a call to dbgAssert. It must be replaced by the code used to:
  • copy the uploaded files into a specific site directory,
  • insert the uploaded files into a binary memo, ...
A code sample is supplied in comment. This code can for example:
  • copy the uploaded files into a specific site directory,
  • insert the uploaded files into a binary memo, ...
See Processes associated with an Upload control for more details.

Control characteristics

Several specific options are available in the "Details" tab of the description of Upload control (accessible via the description of "Add" button):
  • Versions 22 and later
    Use the native HTML5 upload: The code generated to manage the upload is using HTML5. This generation mode of control allows you to use the Upload control in sites available on all platforms (including the mobile platforms that do not support flash).
    New in version 22
    Use the native HTML5 upload: The code generated to manage the upload is using HTML5. This generation mode of control allows you to use the Upload control in sites available on all platforms (including the mobile platforms that do not support flash).
    Use the native HTML5 upload: The code generated to manage the upload is using HTML5. This generation mode of control allows you to use the Upload control in sites available on all platforms (including the mobile platforms that do not support flash).
  • Versions 22 and later
    Use an upload based on Flash: The code generated to manage the upload is using Flash. In this case, the upload will not be available for the platform that do not support flash.
    New in version 22
    Use an upload based on Flash: The code generated to manage the upload is using Flash. In this case, the upload will not be available for the platform that do not support flash.
    Use an upload based on Flash: The code generated to manage the upload is using Flash. In this case, the upload will not be available for the platform that do not support flash.
  • Multi-file selection: allows the multiselection in the control. If this option is not checked, only the upload of a single file will be possible.
  • Encrust the caption in the image: used to insert the button caption into the image associated with the button.
  • Versions 17 and later
    Management of Drag/Drop: Used to allow Drag and Drop from the Windows explorer. See Managing Drag and Drop of files to an Upload control (HTML5) for more details.
    New in version 17
    Management of Drag/Drop: Used to allow Drag and Drop from the Windows explorer. See Managing Drag and Drop of files to an Upload control (HTML5) for more details.
    Management of Drag/Drop: Used to allow Drag and Drop from the Windows explorer. See Managing Drag and Drop of files to an Upload control (HTML5) for more details.
Versions 22 and later
Notes about the generation type of upload:
  • If the Upload control is created in version 22, the option "Use the native HTML5 upload" will be automatically selected in an HTML5 page.
  • If the Upload control was created with an earlier version (preset singlefile or multifile Upload control), you also have the ability to use the generation in HTML 5 format.
New in version 22
Notes about the generation type of upload:
  • If the Upload control is created in version 22, the option "Use the native HTML5 upload" will be automatically selected in an HTML5 page.
  • If the Upload control was created with an earlier version (preset singlefile or multifile Upload control), you also have the ability to use the generation in HTML 5 format.
Notes about the generation type of upload:
  • If the Upload control is created in version 22, the option "Use the native HTML5 upload" will be automatically selected in an HTML5 page.
  • If the Upload control was created with an earlier version (preset singlefile or multifile Upload control), you also have the ability to use the generation in HTML 5 format.
Notes

Multi-file Upload control in AWP

A multi-file Upload control in AWP implicitly creates an AWP context on disk. This type of control is not compatible with the management of contexts via cookies. See Managing AWP contexts for more details.

Various

  • To use the Upload control, Flash (version 7 or later) must be installed on the computer of Web user.To use the Upload control, Flash (version 9 or later) must be installed on the computer of Web user.
    Versions 22 and later
    If the Upload control is based on Flash ("Use an upload based on Flash" checked in the "Details" tab), the Flash player (version 9 or later) must be installed on the computer of the Web user in order for the Upload control to be used.
    New in version 22
    If the Upload control is based on Flash ("Use an upload based on Flash" checked in the "Details" tab), the Flash player (version 9 or later) must be installed on the computer of the Web user in order for the Upload control to be used.
    If the Upload control is based on Flash ("Use an upload based on Flash" checked in the "Details" tab), the Flash player (version 9 or later) must be installed on the computer of the Web user in order for the Upload control to be used.
  • The Upload control cannot be used in an Ajax looper.

Maximum size of files to upload

By default, the size of the files to upload is not limited in the WEBDEV engine. This size can be limited:
  • by the Web server used. See the documentation about the Web server used for more details.
  • by WEBDEV application server.
The file will not be uploaded if its size exceeds the limit size.
To modify the maximum size of the files to upload in the WEBDEV application server, the registry must be modified on the server. This modification can be performed for all the WEBDEV applications.
To modify the size of the uploaded files for all the WEBDEV applications:
  1. Select the following registry key:
    • On a 64-bit computer: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PC SOFT\WEBDEV\23.0
    • On a 32-bit computer: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\23.0
  2. Add the MAX_UPLOAD key. The value of this key corresponds to the maximum size of files to upload (in KB).
Note: A limit linked to the Web server (IIS, Apache, ...) can also exist. For example, for IIS, you have the ability to edit the XML "%windir%\system32\inetsrv\config\applicationhost.config" file and to create or modify the "maxAllowedContentLength" attribute of "requestLimits" tag by specifying the size in bytes.
Example to set the limit to 50 MB in IIS:
<system.webServer>
          <security>
.....
<requestFiltering>
.....
<requestLimits maxAllowedContentLength="52428800"/>
</requestFiltering>
....
PHP Limits in PHP:
  • The size of the uploaded files is limited by the "upload_max_filesize" and "post_max_size" directives in the configuration file of PHP (php.ini file).
  • The file upload must be allowed by the PHP server. To do so, the "file_uploads" directive must be set to "on" in the configuration file of PHP (php.ini file).
  • The upload_tmp_dir directive of the configuration file must be specified toward a directory with read/write rights.
Minimum required version
  • Version 15
Comments
Click [Add] to post a comment