shailsonia
Programmer
Please help me i am trying to upload new link on the webpage. It should display the new one and delete the previous one.
I am copying my code please let me know where I am wrong
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TCF Investments - Upload Product Grids to the Intranet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv='EXPIRES' CONTENT='0'>
<meta http-equiv='Pragma' CONTENT='no-cache'>
<link rel=STYLESHEET href='/styles/standard.css' type='text/css'>
</head>
<body bgcolor="#FFFFFF" class="twelvePtGeneral">
<!-- Begin table to frame page in 800 wide page -->
<table width="760" align="center" border="0" cellpadding="3" cellspacing="0">
<tr>
<td>
<!-- Place entire page inside of this table cell -->
<!-- Begin page header -->
<table width="100%" height="80" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td width="180"">
</td>
<td> </td>
</tr>
</table>
<table width="100%" height="18" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td class="HighlightedHeader" height="100%"><div align="left">
<!--#include virtual="/SSI/welcomeMessage.asp"--></div>
</td>
<td class="HighlightedHeader" height="100%"><div align="right">
<!--#include virtual="/SSI/loginLink.asp"--></div>
</td>
</tr>
</table>
<!-- End page header -->
<%
Dim fso, strFilePath, strDirectory, strFileName
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
strDirectory = "D:\Web Content\IntranetSite\soniatestserveruploaded\"
strFileName = mySmartUpload.Files.Item(1).FileName
strFilePath = strDirectory & strFileName
'Session("Uploaded_ProdGrid_File_Name") = mySmartUpload.Files.Item(1).FileName
' Save the file to a directory on the web server with a new name
' ************************************************************************************
mySmartUpload.Files.Item(1).SaveAs(strFilePath)
For each file In mySmartUpload.Files
Response.Write(file.FileName & " (" & file.Size & "bytes)<BR>")
h = file.FileName
Next
' Verify that the file was uploaded and saved
' *******************************************
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strFilePath) then
'File was successfully uploaded
Response.Write("<BR><CENTER><h3>The file has been posted to the Intranet.</h3><br><br>")
Else
Response.Write("Error in Uploading")
' Response.Redirect "uploadtestlink.htm"
End If
%>
<!-- End of page content -->
</td>
<tr>
</table>
<!-- End of table -->
</body>
</html>
Thanks
Sonia
I am copying my code please let me know where I am wrong
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TCF Investments - Upload Product Grids to the Intranet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv='EXPIRES' CONTENT='0'>
<meta http-equiv='Pragma' CONTENT='no-cache'>
<link rel=STYLESHEET href='/styles/standard.css' type='text/css'>
</head>
<body bgcolor="#FFFFFF" class="twelvePtGeneral">
<!-- Begin table to frame page in 800 wide page -->
<table width="760" align="center" border="0" cellpadding="3" cellspacing="0">
<tr>
<td>
<!-- Place entire page inside of this table cell -->
<!-- Begin page header -->
<table width="100%" height="80" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td width="180"">
</td>
<td> </td>
</tr>
</table>
<table width="100%" height="18" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td class="HighlightedHeader" height="100%"><div align="left">
<!--#include virtual="/SSI/welcomeMessage.asp"--></div>
</td>
<td class="HighlightedHeader" height="100%"><div align="right">
<!--#include virtual="/SSI/loginLink.asp"--></div>
</td>
</tr>
</table>
<!-- End page header -->
<%
Dim fso, strFilePath, strDirectory, strFileName
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
strDirectory = "D:\Web Content\IntranetSite\soniatestserveruploaded\"
strFileName = mySmartUpload.Files.Item(1).FileName
strFilePath = strDirectory & strFileName
'Session("Uploaded_ProdGrid_File_Name") = mySmartUpload.Files.Item(1).FileName
' Save the file to a directory on the web server with a new name
' ************************************************************************************
mySmartUpload.Files.Item(1).SaveAs(strFilePath)
For each file In mySmartUpload.Files
Response.Write(file.FileName & " (" & file.Size & "bytes)<BR>")
h = file.FileName
Next
' Verify that the file was uploaded and saved
' *******************************************
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strFilePath) then
'File was successfully uploaded
Response.Write("<BR><CENTER><h3>The file has been posted to the Intranet.</h3><br><br>")
Else
Response.Write("Error in Uploading")
' Response.Redirect "uploadtestlink.htm"
End If
%>
<!-- End of page content -->
</td>
<tr>
</table>
<!-- End of table -->
</body>
</html>
Thanks
Sonia