- Maximum size of files to upload
- Pre-launched sessions
In french: UploadNomFichier
Returns the name of a file "uploaded" by the Web user. This upload may have been performed:
- via an "Upload" edit control.
- via a single-file or multi-file Upload control.
This function is available in Ajax for the new single-file or multi-file Upload controls.
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, fFile + fExtension)
// Copy the file
<Result> = UploadFileName(<Upload control> [, <File location> [, <File index>]])
<Result>: Character string
Name of uploaded file.
<Upload control>: Control name
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 index>: Optional integer
Subscript of file whose name must be retrieved. This parameter is only used for an upload performed with the multi-file Upload control. By default, this index is 1.
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 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:
- To modify the size of the uploaded files for all the WEBDEV 28 applications, select the following key: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\28.0 on a 32-bit computer and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PC SOFT\WEBDEV\28.0 on a 64-bit computer.
- Add the MAX_UPLOAD string. The value of this string will be the maximum size of files to upload (in KB).
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.
If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initializing the project after connection to the site" event.
Unit examples (WEBDEV): Uploading or Downloading a file