Forum Moderators: open
I registered the ASPUploadComponent.dll in my domain server(say www.example.com.my) using regsver32 command,it prompted me that registered successfully.
But still i am not abe to use that component.What is just wrote is
<%
Option Explicit
Dim objUpload, strUploadPath, strMsg, strFileExtensions
'create the ActiveX object
Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")
Response.Write("object created")
%>
but it is not working out.can you pls tell me where i am going wrong.
thanks.
sunitha
[edited by: engine at 11:53 am (utc) on Oct. 21, 2003]
Now i am able to register the component in our server and able to access it,but the problem i am getting is
i created two files
one is upload.asp file and another is uploadcomplete.asp file.
upload.asp file code is like this
<html>
<head>
<title>VB Web ASP File Upload</title>
</head>
<body>
<form action="uploadcomplete.asp" method="POST" enctype="multipart/form-data">
<p>Please select a file to upload, and enter a description for it.</p>
<p><b>File: </b><input type="file" style="width: 300;" name="thefile"><br>
<b>Description:</b><br><textarea name="description" rows=4 cols=30></textarea></p>
<input type="submit" value="Upload">
</form>
</body>
</html>
and uploadcomplete.asp is like this
<%
Option Explicit
Dim objUpload, strUploadPath, strMsg, strFileExtensions
'create the ActiveX object
Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")
'Response.Write("object created")
'set the upload path
strUploadPath = "http:\\www.example.com.my\"
'set the file extensions to exclude
strFileExtensions = ".exe;.dll"
If objUpload.FieldExists("thefile") = False Then
Response.Write "Invalid Post Data"
Response.End
Else
'file posted...
'attempt to save the file
On Error Resume Next
objUpload.Form("thefile").SaveFile strUploadPath, objUpload.Form("thefile").Value, strFileExtensions
If Err Then
'an error occured... ie file already exists, invalid extension etc
strMsg = "Error " & Err.Number & ": " & Err.Description
Else
'add description to the database?
'cConn.Execute ("INSERT INTO mydocs (FileName,Description) VALUES ('" & objUpload.Form("thefile").Value & "','" & objUpload.Form("description").Value
strMsg = "The file was successfully uploaded."
End If
End If
%>
<html>
<head>
<title>VB Web ASP File Upload Complete</title>
</head>
<body>
<p><%=strMsg%></p>
<p><b>File Name:</b> <%=objUpload.Form("thefile").Value%><br>
<b>File Size:</b> <%=objUpload.Form("thefile").FileSize%><br>
<b>Content Type:</b> <%=objUpload.Form("thefile").ContentType%><br>
<b>Description:</b> <%=objUpload.Form("description").Value%></p>
</body>
</html>
here i am trying to upload the any browsed file to our domain server(say www.example.com.my)
but i am getting the below error
Error -2147221400: The folder to upload to doesn't exist
File Name: md-training.txt
File Size: 2022
Content Type: text/plain
Description: file uploading for testing
could you pls help me where i am going wrong.
i am very greateful to you.
thanks and regards
sunitha.
[edited by: engine at 7:27 am (utc) on Oct. 22, 2003]
[edit reason] no specifics, thanks. See [url=http://www.webmasterworld.com/help.cgi?cat=tos]TOS[/ur [/edit]
i think i am going wrong in mensioning the path
strUploadPath = "http:\\www.example.com.my\"
like this,i am i correct?if so,tell me correct path to mension.
thanks & regards,
sunitha
[edited by: engine at 7:28 am (utc) on Oct. 22, 2003]
[edit reason] No specifics, thanks. See [url=http://www.webmasterworld.com/help.cgi?cat=tos]TOS[/ur [/edit]
thanks and regards
sunitha