PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Processes managed by default
  • Process for receiving the files
  • Example
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
Processes associated with the Upload control
Processes managed by default
WEBDEV manages the following processes by default on the Upload control (in the order in which they appear in the code editor):
ProcessRuntime condition
Initializing
(Server code)
Run when opening the page. *
Whenever the list of selected files is modified
(Browser code)
Run when modifying the list of files to upload.
For a single-file Upload control, this process is run whenever a file is selected.
For a multi-file Upload control, this process is run whenever a file is added into the list.
Progress of transfer
(Browser code)
Run when sending the files to the server.
During the progress of the upload, this process is called on a regular basis in order to update a possible progress bar.

Note: This process continues to be called after the end of the transfer. If it used to trigger an action in server code (via ExecuteProcess on a Submit button or via AJAXExecute for example), make sure that the process will not be called several times (by protecting its call by a boolean variable for example).
For more details, see the WW_Upload example supplied with WEBDEV.
Receiving the uploaded files
(Server code)
Run when receiving the files uploaded by the server.
CAUTION: If you used the preset upload controls (single-file or multi-file), the code found in this process must be modified to specify the location where the files must be copied on the server.
Versions 17 and later
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code. At the end of upload, this process is used to update the page without performing an additional round trip to the server.
New in version 17
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code. At the end of upload, this process is used to update the page without performing an additional round trip to the server.
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code. At the end of upload, this process is used to update the page without performing an additional round trip to the server.
Versions 17 and later
After receiving the uploaded files
(Browser code)
New in version 17
After receiving the uploaded files
(Browser code)
After receiving the uploaded files
(Browser code)
Run when all the files have been uploaded on the server.
Allows you among other things, to run a browser process when the upload is done, without having to go back to the server.
(*) By default, the "Initialization" process of each control is run according to the creation order of controls in the page. To modify this runtime order:
  1. Select "Page .. Navigation order .. Edit".On the "Page" pane, in the "Edit" group, expand "Navigation" and select "Edit".
  2. In the window that is displayed, use the arrows on the right to modify the initialization order of controls.
Versions 17 and later
Notes:
  • In the Upload controls created with an earlier WEBDEV version (before version 17), the process "After receiving the uploaded files (Browser code)" is automatically added.
  • If the Upload control is created from version 17, the code generated in the Upload control is optimized in order to use the process "After receiving the uploaded files".
New in version 17
Notes:
  • In the Upload controls created with an earlier WEBDEV version (before version 17), the process "After receiving the uploaded files (Browser code)" is automatically added.
  • If the Upload control is created from version 17, the code generated in the Upload control is optimized in order to use the process "After receiving the uploaded files".
Notes:
  • In the Upload controls created with an earlier WEBDEV version (before version 17), the process "After receiving the uploaded files (Browser code)" is automatically added.
  • If the Upload control is created from version 17, the code generated in the Upload control is optimized in order to use the process "After receiving the uploaded files".
Process for receiving the files
The process "Receiving the files uploaded" is used to manage the location of files uploaded on the server. This process is also used to manage the parameters passed by UploadStart.
Indeed, UploadStart is used to start the file upload. If UploadStart is called with additional parameters, these parameters are transmitted to the process "Receiving the uploaded files" at the end of upload. To retrieve these parameters, a procedure must be declared in this process (via the PROCEDURE statement).
This procedure has the following format:
PROCEDURE ProcedureName(<Parameter 1> [, ... [, <Parameter N>]])
The "Receiving the uploaded files" process can also be used to load the uploaded images into a memo item of a HFSQL file, via HLinkMemo.
Limit: The code used in the process "Receiving the uploaded files" cannot manage any display.
Versions 17 and later
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code.
New in version 17
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code.
The process "Receiving the uploaded files" is run in AJAX. You have the ability to use all the functions supported in AJAX server code.
Code sample used in the process "Receiving the uploaded files":
// Insert the code for processing uploaded files
// Code sample:
// Copies the uploaded file into a specific directory
// UploadCopyFile(MySelf, sDestinationDirectory, "")

// Process each file to upload
FOR subscript = 1 TO NbFilesToUpload
Trace(UploadFileName(UPL_Upload, False, subscript))
Trace(UploadFileName(UPL_Upload, True, subscript))
UploadCopyFile(UPL_Upload, "c:\temp2", "", subscript)
END
Example
Code sample used to load the images uploaded from a multi-file Upload control in a memo item.
// For each uploaded image
FOR i = 1 _TO_ UPL_UploadControl..Occurrence
// Add into the database
HReset(Photo)
ScreenToFile()

// UploadFileName(UPL_UploadControl, True, i):
// is used to retrieve the path of the nth file uploaded on the server
// This file is a temporary file created on the server
// This file is automatically deleted at the end of process
// "receiving the uploaded files"
HLinkMemo(Photo, Image, UploadFileName(UPL_UploadControl, True, i))

HAdd(Photo)
END
Minimum required version
  • Version 15
Comments
Click [Add] to post a comment