AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas de la Web / Funciones de carga de archivos (Upload)
  • Tamaño máximo de los archivos a cargar
  • Pre-launched sessions
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Returns the name of a file "uploaded" by the Web user. This file must have been uploaded:
  • via a single-file or multi-file Upload field. For more details, see Upload control.
  • via an "Upload" Edit control (kept for compatibility).
Ajax This function is only available in AJAX for new single-file or multi-file Uploads.
Ejemplo
// Multi-file Upload control
// "Receive files uploaded" event
// For each file
FOR I = 1 _TO_ UPL_Upload.Count
	// Retrieves the file name on the user computer
	sFileName is string = UploadFileName(UPL_Upload, False,I)
	// Upload the file into the _WEB directory
	sCopiedFileName is string = UploadCopyFile(UPL_Upload, fDataDir(), "",I)
	// Checks whether the file was copied
	IF fFileExist(fDataDir() + "\" + sCopiedFileName) THEN
		gsUploadedFile = fDataDir() + "\" + sCopiedFileName
	END
END
// Upload Edit control
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
	fCopyFile(SourceFile, DestFile)
END
Sintaxis
<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:
  • a single-file or multi-file Upload control field.
  • an "Upload" Edit control. This control contains the name and path of the file that will be sent to the server.
<File location>: Optional boolean
Location of file whose name you want to get:
  • True (default): Name of the uploaded file on server.
  • False: Name of the file to be uploaded (on the user's computer).
<File index>: Optional integer
Index of the file whose name is to be retrieved. This parameter is only used for an upload performed with the multi-file Upload control. By default, this index is 1.
Observaciones

Tamaño máximo de los archivos a cargar

Por Default, el tamaño de los archivos a cargar no está limitado en el motor WEBDEV. Este tamaño puede estar limitado por el WEBDEV Application Server.
El archivo no se cargará si su tamaño supera el tamaño límite.
Para modificar el tamaño máximo de los ficheros a subir en el WEBDEV Application Server, hay que modificar el registro en el servidor:
  1. Para cambiar el tamaño de los archivos cargados para todas las aplicaciones WEBDEV 2025, seleccione la siguiente tecla:
    • 32 bits: HKEY_LOCAL_MACHINE\SOFTWARE\PC SOFT\WEBDEV\30.0
    • 64 bits: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PC SOFT\WEBDEV\30.0
  2. Añadir la cadena MAX_UPLOAD. El valor de esta cadena será el tamaño máximo de los archivos a subir (en KB).
PHP Límites en PHP:
  • El tamaño de los archivos subidos está limitado por la directiva "upload_max_filesize" del archivo de configuración de PHP (archivo php.ini).
  • La carga de archivos debe estar permitida por el servidor PHP. Para ello, la directiva "file_uploads" debe estar en "on" en el fichero de configuración de PHP (fichero php.ini).
  • La directiva upload_tmp_dir del archivo de configuración debe especificarse hacia un directorio con derechos de lectura/escritura.

Pre-launched sessions

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 "Initialization in pre-launched session mode" event.
Componente: wd300page.dll
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local