PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Events managed by default
  • Event 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
Events associated with the Upload control
Events managed by default
WEBDEV manages the following events by default (in order of appearance in the code editor) in the Upload control:
EventRuntime 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 event is run when a file is selected.
For a multi-file Upload control, this event is run when a file is added to the list.
Progress of transfer
(Browser code)
Run when sending the files to the server.
This event is called regularly during the upload to update a progress bar, if available.

Note: This event 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 (protect its call with 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 use the preset Upload controls (single-file or multi-file), the code in this event must be modified to specify the server location where the files must be copied.
Versions 17 and later
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code. This events makes it possible, once the upload is complete, to update the page without communicating with the server again.
New in version 17
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code. This events makes it possible, once the upload is complete, to update the page without communicating with the server again.
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code. This events makes it possible, once the upload is complete, to update the page without communicating with the server again.
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 to run a browser process when the upload is complete, without communicating with the server again.
(*) By default, the "Initializing" event of each control is run according to the order in which the controls were created 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 Upload controls created with an earlier WEBDEV version (before version 17), the event "After receiving the uploaded files (Browser code)" is automatically added.
  • From version 17 onwards, the code generated in the Upload control is optimized to use the event "After receiving the uploaded files".
New in version 17
Notes:
  • In Upload controls created with an earlier WEBDEV version (before version 17), the event "After receiving the uploaded files (Browser code)" is automatically added.
  • From version 17 onwards, the code generated in the Upload control is optimized to use the event "After receiving the uploaded files".
Notes:
  • In Upload controls created with an earlier WEBDEV version (before version 17), the event "After receiving the uploaded files (Browser code)" is automatically added.
  • From version 17 onwards, the code generated in the Upload control is optimized to use the event "After receiving the uploaded files".
Event for receiving the files
The event "Receiving the files uploaded" is used to manage the location of files uploaded on the server. This event 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 event "Receiving the uploaded files" at the end of upload. To retrieve these parameters, a procedure must be declared in this event (via the PROCEDURE statement).
This procedure has the following format:
PROCEDURE ProcedureName(<Parameter 1> [, ... [, <Parameter N>]])
The event "Receiving the uploaded files" can also be used to load the uploaded images into a memo item of an HFSQL file, via HLinkMemo.
Limit: The code used in the event "Receiving the uploaded files" cannot manage any display.
Versions 17 and later
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code.
New in version 17
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code.
The event "Receiving the uploaded files" is run in AJAX. You can use all the functions supported in AJAX server code.
Code sample used in the event "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 the event
// "Receiving the uploaded files"
HLinkMemo(Photo, Image, UploadFileName(UPL_UploadControl, True, i))
 
HAdd(Photo)
END
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment