PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Maximum size of files to upload
  • Pre-launched sessions
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
Returns the name of a file "uploaded" by the Web user. This upload may have been performed:
  • via an "Upload" edit control.
  • Versions 15 and later
    via a single-file or multi-file Upload control.
    New in version 15
    via a single-file or multi-file Upload control.
    via a single-file or multi-file Upload control.
Versions 17 and later
Ajax This function is available in Ajax for the new single-file or multi-file Upload controls.
New in version 17
Ajax This function is available in Ajax for the new single-file or multi-file Upload controls.
Ajax This function is available in Ajax for the new single-file or multi-file Upload controls.
Example
SourceFile, DestFile are strings
// EDT_File is the name of the edit control containing the full name of file to upload

// Find the name of the file uploaded on the server
SourceFile = UploadFileName(EDT_File)
// If SourceFile exists, copy it into the directory of documents on the server
IF SourceFile <> "" THEN
// Find the name of the file uploaded on the client
DestFile = UploadFileName(EDT_File, False)
DestFile = "c:\documents\" + fExtractPath(DestFile, fFileName + fExtension)
// Copy the file
fCopyFile(SourceFile, DestFile)
END
Syntax
<Result> = UploadFileName(<Control Name> [, <File Location> [, <File Subscript>]])
<Result>: Character string
Name of uploaded file.
<Control Name>: Character string (with or without quotes)
Name of control used for upload. This control can be:
  • an "Upload" edit control. This control contains the name and path of the file that will be sent to the server.
  • a single-file or multi-file Upload control.
<File Location>: Optional boolean
Location of file whose name is requested:
  • True (default value): Name of uploaded file found on the server.
  • False: Name of file to upload found on the computer of Web user.
<File Subscript>: Optional integer
Versions 15 and later
Subscript of file whose name must be retrieved. This parameter is only used for an upload performed with the multi-file Upload control. This subscript is corresponds to 1 by default.
New in version 15
Subscript of file whose name must be retrieved. This parameter is only used for an upload performed with the multi-file Upload control. This subscript is corresponds to 1 by default.
Subscript of file whose name must be retrieved. This parameter is only used for an upload performed with the multi-file Upload control. This subscript is corresponds to 1 by default.
Remarks

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. 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 files to upload in WEBDEV application server, the registry must be modified on the server:
  1. To modify the size of uploaded files for all WEBDEV 23 applications, select the following key: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\23.0
  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).
Versions 20 and later

Pre-launched sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
New in version 20

Pre-launched sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

Pre-launched sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
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
Components
WEBDEV - Server code wd230page.dll
Linux wd230page.so
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment