|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: ASP file upload question |
From: |
Neilam Chaudhari |
Date: |
5/3/2001 5:12:06 PM |
IP: |
66.56.0.216 |
I had the same problem, but I found out that my server running IIS5.0 had ASPUpload installed. I used the documentation for that to actually upload the file to a specified directory. Here is the code (it must be within <form></form> tags):
<%
Set Upload = Server.CreateObject ("Persits.Upload.1")
Count = Upload.SaveVirtual ("/data")
msg = "<font face=times size=3 color=#FF0000><b>" & Count & " file(s) attached</b></font>"
Response.write msg
%>
If you can get the file to your directory another way, here is the code to parse the file from the form so you can extract just the filename to insert into your database (assumes File1 is the name of the input field for the file):
<%
my_fullfile1=Request.Form("File1")
my_splitfile1=Split(my_fullfile1, "\")
my_file1=Ubound(my_splitfile1)
my_file1=my_splitfile1(my_file1)
(Server.Mappath("/data/" & my_file1))
%>
Just replace "/data/" with whatever folder holds the file you want and replace "File1" with the name of the file input box on your form. I hope this helps. |
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|