I am writing this code for file upload in asp 3.0 on my webpage........
It is working on local system but when i want to upload an image on my
website from client machine it is not working .......
can somebody help me
<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%
'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
' FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
' FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
' OR LATER.
' Create the FileUploader
Dim Uploader, File, Rs
Set Uploader = New FileUploader
' This starts the upload process
Uploader.Upload()
'******************************************
' Use [FileUploader object].Form to access
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
Response.Write "<b>Thank you for your upload " &
Uploader.Form("fullname") & "</b><br>"
' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items
' Check where the user wants to save the file
If Uploader.Form("saveto") = "disk" Then
' Save the file
File.SaveToDisk "E:\upload"
ElseIf Uploader.Form("saveto") = "database" Then
dim connection
dim sSQL, sConnString
sSQL = "INSERT INTO MyUploadTable (filename, filesize,
contenttype)VALUES('"&File.FileName&"','"&File.Fil eSize&"','"&File.ContentType&"')"
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("emails.mdb")
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
connection.execute(sSQL)
response.write "The data was inserted successfully."
Connection.Close
Set Connection = Nothing
End If
' Output the file details to the browser
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
Next
End If
%>