What browsers are compatible with .asp files?
You may use the following browsers
(RFC 1867-compliant) to upload files:
Netscape 3.0 and higher (include Mozilla Firefox), Opera,.
Microsoft Internet Explorer 4.0 and higher.
How do I upload to
a data directory?
You may upload up to three files and the corresponding asp script to a data
directory by creating the following HTML form:
dataupload.asp
Uploading files to a to a database requires a few more lines of code than
that of a data directory as follows:
<% Set Upload = Server.CreateObject ("Persits.Upload.1") '
Upload files
Upload.OverwriteFiles = False ' Generate unique names
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.SaveVirtual "/data" ' Save to data directory
' Process all files received
For Each File in Upload.Files
File.ToDatabase ' Save in the database as blob
"DSN=userid.dsn_name;UID=user_id;PWD=account_Password;",_
"insert into UploadTable (id, FilePath, image)values (12, '" & File.Path
& '",?)"
Next
Display description field
Response.Write Upload.Form ("Description") & "<BR>"
Display all selected categories
For Each Item in Upload.Form
If Item.Name = "Category" Then
Response.Write Item.Value & "<BR>"
End If
Next
%>
Note: The "_" at the end of a line is the end of that line and
no more code should follow on that line as it is a signal to ASP
that this string of code follows on the next line.
How do I upload an
image from my database to a web page?
To include an uploaded image from your database in a web page you can use
a regular <IMG> tag in your HTML page with the SRC attribute pointing
to the asp script. Please see the following examples:
getimage.asp
<% Set Upload = Server.CreateObject ("Persits.Upload.1")
Set db = Server.CreateObject("ADODB.Connection")
db.Open "userid.dsn"
Set rs =db.Execute("SELECT image FROM uploadTable where id = " & Request("id"
)
Response.ContentType = "image/gif"(or "image/jpeg")
Response.BinaryWrite rs("image")
%>
Which
methods and properties are disabled for ASP Upload?
The UploadManager.Save method
is disabled.
Note: When the UploadManager.Save
method is disabled, ASP Upload users will have to use the SaveVirtual method.
That method accepts a virtual, rather than physical, directory as an argument.
This way, users will be confined to their own virtual directory and subdirectories.
The UploadManager.FileCopy and UploadedFile.Copy methods are disabled.
Note: When the UploadManager.FileCopy and the UploadedFile.Copy methods are disabled, the users will be forced to use UploadedFile.CopyVirtual.
In addition to the above-mentioned methods,
the following methods are also disabled: