PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Operating mode of the file upload performed via the Upload control
  • Limits
  • 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
Starts sending the selected files into an Upload control. At the end of the upload, the list of the files to send is cleared on the browser (no matter whether the control sends one or more files).
Example
// -- Event "Whenever modifying the list of selected files"
// in the UPL_Upload control
// Starts sending the file and transmits the content of EDT_Family control
UploadStart(MySelf, EDT_Family)
// -- Event "Receiving the uploaded files"
PROCEDURE Reception(FamilyName)
// Copies the file into the directory corresponding to the family
UploadCopyFile(MySelf, CompleteDir(sDestinationDirectory) + FamilyName, "")
Syntax
UploadStart(<Upload control> [, <Parameter 1> [... [, <Parameter N>]]])
<Upload control>: Character string (with or without quotes)
Name of Upload control to use.
<Parameter 1>: Any type
First parameter that must be passed to the server event "Receiving the uploaded files". To retrieve this parameter, a procedure in the following format must be declared in the event "Receiving the uploaded files":
PROCEDURE ProcedureName(<Parameter 1> [, ... [, <Parameter N>]])
PHP If this function is used in a PHP site, you cannot specify the parameters to pass to the server event "Receiving the uploaded files". This feature is not supported in PHP.
<Parameter N>: Any type
Nth parameter that must be passed to the server event "Receiving the uploaded files". To retrieve this parameter, a procedure in the following format must be declared in the event "Receiving the uploaded files":
PROCEDURE ProcedureName(<Parameter 1> [, ... [, <Parameter N>]])
PHP If this function is used in a PHP site, you cannot specify the parameters to pass to the server event "Receiving the uploaded files". This feature is not supported in PHP.
Remarks

Operating mode of the file upload performed via the Upload control

Several events are associated with the Upload control (single or multi-file):
  • For a single-file Upload control, these events are associated with the "Send" button.
  • For a multi-file Upload control, these events are associated with the "Add" button.
The events used when uploading the selected files are:
  • Browser event "Progress of transfer":
    This event is called regularly during the upload to update a progress bar, if available.
  • Server event "Receiving the uploaded files":
    This event is run when all the files are received by the server.
    Note: If UploadStart is called with additional parameters, these parameters are transmitted to the event "Receiving the uploaded files". To retrieve these parameters, a procedure must be declared in this event (via the PROCEDURE statement).

Limits

Modifications performed in the server event "Receiving the uploaded files" are NOT carried over to the browser. These modifications will be visible during the next display of the page.

Maximum size of files to upload

By default, the size of files to upload is not limited in the WEBDEV engine. This size can be limited:
  • by the Web server used (IIS, Apache, etc.).
    See the documentation about the Web server used for more details.
    For example, with the IIS server, in the Web server configuration, "Filtering requests" section, click "Modify the function parameters..." and modify the "Maximum allowed content length (bytes)" section.
    Another method to access this setting is to go via the "configuration editor" of IIS, section "system.webServer/security/requestFiltering" sect ion, "requestLimits" and "maxAllowedContentLength" choices..
  • by the WEBDEV application server.
    The file will not be uploaded if its size exceeds the limit size.
    To modify the maximum size of files to upload in WEBDEV application server, the registry must be modified on the server:
    1. To modify the size of the uploaded files for all the WEBDEV 24 applications, select the following key: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\24.0 on a 32-bit computer and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PC SOFT\WEBDEV\24.0 on a 64-bit computer.
    2. Add the MAX_UPLOAD string. The value of this string will be the maximum size of files to upload (in KB).
PHP Limits in PHP:
  • The size of the uploaded files is limited by the "upload_max_filesize" directive 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.
Related Examples:
Uploading or Downloading a file Unit examples (WEBDEV): Uploading or Downloading a file
[ + ] This example explains how to upload (copy to the server) or download (download from the server) a file and it allows you to:
- Copy a file from the browser computer to the server
- Download a file found on the server
- Download a file found on the server via a link
- Download a file found on the server by requesting its opening
Component : WDJS.DLL
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment