SaveInVirtual Method

 Object: SoftArtisans.FileUp
 Syntax: SaveInVirtual ([in] VirtualLocation)
 Description: This method saves an uploaded file to the web server's hard disk in a location specified by the virtual directory or filename in a virtual directory.

SaveInVirtual uses ASP's intrinsic Server.MapPath function. As with the MapPath function, you specify either a virtual directory or a filename. If you specify a filename, it is resolved in the current virtual directory.

The Web Administrator can disable all other save methods except SaveInVirtual. This prevents the Web Developer from writing to non-virtual directory locations on the server. See Disabling SA-FileUp features.

If there is more than one file being uploaded in a single page, only the first one is saved.

To save multiple files in a single upload, there is an equivalent method for each file object, i.e., upl.Form("FILE1").SaveInVirtual "filename".

Example 1:

	<%
		On Error Resume Next
		'---
		'--- Save the file now
		'---
		upl.SaveInVirtual "/mywebapp/uploads"
		If Err <> 0 Then
			 Response.Write("An error occurred when saving the file on the server.")
	... %>

Example 2:

	<%
		On Error Resume Next
		'---
		'--- Save the file now
		'---
		upl.SaveInVirtual "uploads/myfile.ext"
		If Err <> 0 Then
			 Response.Write("An error occurred when saving the file on the server.")
	... %>

 

Previous Page Next Page