PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Maximum size of files to upload
  • Name of uploaded file
  • Pre-launched sessions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Saves on the server 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.
During this backup, the copied file can be renamed on the server.
Versions 15 and later
PHP This function is now available for PHP sites.
New in version 15
PHP This function is now available for PHP sites.
PHP This function is now available for PHP sites.
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.
// Récupération du fichier envoyé par le client
refFic is string
refFic = UploadCopyFile(SAI_File, "C:\Documents", "REF_3304")
// Si le fichier source est: "/User/Truc.jpg"
// refFic = "REF_3304.jpg" et le fichier a été copié dans "C:\documents\REF_3304.jpg"
// Upload réalisé à partir d'un champ Upload multifichier
// Pour chaque fichier envoyé
FOR i = 1 _TO_ UPL_Upload..Count
// Copie le fichier dans le répertoire des données
UploadCopyFile(UPL_Upload, fDataDir(), "",  i)
END
Syntax
<Result> = UploadCopyFile(<Upload control> , <Path on server> , <File name> [, <File index>])
<Result>: Character string
  • Name (name + extension) of the file uploaded on the server (does not contain the file path),
  • Empty string ("") if an error occurred.
<Upload control>: Character string (with or without quotes)
Name of Upload control used. This control can correspond to:
  • an "Upload" edit control. This control contains the name and path of the file that will be sent to the server.
    Remark: it is possible to use the attribute of a Looper control (Value property for the attribute).
  • a single-file or multi-file Upload control.
<Path on server>: Character string (with quotes)
Path of server directory where the file will be copied. This path can correspond to the path returned by fDataDir. This path can also correspond to fCurrentDir, but the hosts rarely give the rights to write in this directory.
Linux This parameter is ignored. The file is uploaded in the "/tmp" directory of Linux server. This directory cannot be modified.
<File name>: Character string (with quotes)
Name (name and extension) of the file uploaded on the server. The file is overwritten if it already exists.
If this parameter corresponds to:
  • an empty string (""): the file name on the server will be identical to the file name on the computer of the Web user.
  • the file name only (without the extension), the file extension on the server will be identical to the file extension on the computer of the Web user.
  • the file name and the file extension, this name and this extension will be used when copying the file to the server.
<File index>: Optional integer
Versions 15 and later
Subscript of the file to save on the server. 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 the file to save on the server. 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 the file to save on the server. 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 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 change the size of uploaded files for all WEBDEV 27 applications, select the: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\27.0 on a 32-bit computer and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PC SOFT\WEBDEV\27.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.

Name of uploaded file

UploadFileName is used to find out the name of an "uploaded" file.
Versions 20 and later

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".
New in version 20

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. This function must be used in the event "Initializing the project after connection to the site".
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: wd270page.dll
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment