SaveFileToSessionFile Method


Context.Session.SaveFileToSessionFile as L (SourceFile as C, Key as C [, RemoveAfterFirstRetrieval as L [,SaveAsynchronously as L = .t.])



The full path of the file from which the contents are to be saved into the current session.


The key for the data stored in the current session. The value of key is a unique name.


Default value is .t.. This option is only honored by the classic server.


Default value is .t.. Set this value to .f. (false) to force the function to wait until data is written to the session storage. When SaveAsynchronously is set to .t. (true) the data will be written concurrently while your server side code continues. The request will not end until the task to write the data completes.


Saves source file content to the current session using the provided key.


Context.Session.SaveFileToSessionFile() saves the contents of the source file to the current session. The behavior of the function will vary depending on the server and whether session storage is enabled. When running Alpha Anywhere Application Server for IIS the default setting is to write the data into a collection that must be stored and retrieved on each request. Enabling session storage causes the server to store the data separately from the session state collection. This greatly improves performance when files are stored as part of the session state. Alpha Cloud always uses session storage. File objects are stored on Amazon S3 and managed by Alpha Cloud. Alpha Anywhere Application Server (classic edition) stores files on disk, but fully supports session storage as an option. Check Context.Session.CallResult.Success before using the return value.

See Also