hej,
har en funktion där man ska kunna ladda upp filen bookmark.htm från datorn. Detta fungerar dock inte.
Tacksam för all hjälp.
Felmeddelande:
Persits.Upload.1 error '800a0005'
The system cannot find the path specified.
/sitemarks/import2.asp, line 44
som är raden
Upload.Save(UPLOADDIR)
i följande kod.
<%
Response.Buffer = True
'
' #: import2.asp
'
' Handles POST-data from import1.asp, takes care of the uploaded file.
'
'
If ( Session("conquermarks_id") = "" ) Then
Response.Redirect( "default.asp" )
End If
If (IMPORT = 0) Then
Response.Redirect( "organize.asp" )
End If
Dim errorMessage, FilePath, FSO
errorMessage = ""
FilePath = UPLOADDIR & Session("conquermarks_id") & "bookmark.htm"
' delete the bookmarkfile if it exists already
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If (FSO.FileExists(FilePath)) Then
FSO.DeleteFile FilePath, 1
End If
Set FSO = Nothing
Function GetUpload(FilePath)
' upload the file a user submited
Dim Upload, File
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
Upload.SetMaxSize 300000, False 'no files bigger than 300KB allowed
Upload.Save(UPLOADDIR)
For Each File in Upload.Files
Response.Write "Filen uppladdad, storlek: " & File.Size / 1000 & " KB<BR><BR>" & vbcrlf
File.Attributes = &H1 'Read-Only
File.Move FilePath
Next
End Function
Function ParseFile(FilePath)
Dim FSO, TSO, strLine, strFolderName(10), strURL, strName, intPos, intStart, intSlut, intFolderNr, FolderCount, FavoriteCount, i
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set TSO = FSO.OpenTextFile(FilePath, 1, 0, 0) 'ForReading, nocreate, asciimode
intFolderNr = 0
strFolderName(0) = ""
FolderCount = 0
FavoriteCount = 0
Do Until TSO.AtEndOfStream
strLine = TSO.ReadLine
strURL = ""
strName = ""
Invalid = 0
intPos = InStr(1, strLine, "FOLDED") 'look for a folder
If (intPos > 0) Then 'found a folder
FolderCount = FolderCount + 1
strLine = Mid(strLine, intPos)
intStart = InStr(1, strLine, ">")
intSlut = InStr(1, strLine, "<")
intFolderNr = intFolderNr + 1
strFolderName(intFolderNr) = Mid(strLine, intStart+1, intSlut-intStart-1)
For i = 1 To intFolderNr
Response.Write " "
Next
Response.Write "<img src='images/closed.gif' border=0 width=18 height=17 align=absmiddle><b>" & strFolderName(intFolderNr) & "</b><br>" & vbcrlf
End If
intPos = InStr(1, strLine, "</DL>") 'look for a folderend
If (intPos > 0) Then 'found a folderend
If (intFolderNr > 0) Then
strFolderName(intFolderNr) = ""
intFolderNr = intFolderNr - 1
End If
Response.Write "<br>" & vbcrlf
End If
intPos = InStr(1, strLine, "HREF") 'look for a bookmark
If (intPos > 0) Then 'found a bookmark
FavoriteCount = FavoriteCount + 1
strLine = Mid(strLine, intPos+6)
intSlut = InStr(1, strLine, """")
strURL = Mid(strLine, 1, intSlut-1) 'the url has been found
intStart = InStr(1, strLine, ">")
intSlut = InStr(1, strLine, "<")
If(Left(strLine,11) = "javascript:") Then
Invalid = 1
End If
If Invalid = 0 Then
strName = Mid(strLine, intStart+1, intSlut-intStart-1) 'the urlname has been found
End If
End If
If (strURL <> "" AND Invalid = 0) Then
For i = 1 To intFolderNr
Response.Write " "
Next
If Len(strName) > 55 Then
strName = Left(strName, 55)
strName = Trim(strName)
strName = strName & "..."
End If
Response.Write "<img src='images/iebookmark.gif' width=18 height=17 border=0><a href='" & strURL & "'>" & strName & "</a><br>" & vbcrlf
End If
Loop
TSO.close
Set TSO = Nothing
Set FSO = Nothing
Response.Write vbcrlf & "<br>Hittade " & FavoriteCount & " favoriter, i " & FolderCount & " foldrar.<br>" & vbcrlf
Response.Write "Klicka på ok om du vill importera dessa.<br>" & vbcrlf
End Function
%>
<html>
<head>
<title>Sitemarks - Sitetips.nu</title>
<link rel="stylesheet" type="text/css" href="default.css">
<script language="JavaScript">
<!--
function openCompactMode()
{
var m_compact
m_compact = window.open('compact.html', m_compact, 'toolbar=no,width=180,height=450,resizable=1');
m_compact.focus();
}
function Layer()
{
textlager.style.visibility = 'visible';
submitknapp.style.visibility = 'hidden';
}
//-->
</script>
</head>
<!--#include file="inc_header.asp"-->
<!--#include file="inc_menu.asp"-->
</td>
<td width="100%" valign="top" align="justify">
<p class="Caption"><b>import</b></p>
<%
GetUpload(FilePath)
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If (FSO.FileExists(FilePath)) Then
Set FSO = Nothing
ParseFile(FilePath)
Else
Set FSO = Nothing
errorMessage = "Ingen fil vald för importering."
End If
%>
<form action="import3.asp" method="POST" enctype="multipart/form-data">
<%
If (errorMessage <> "") Then
Response.Write("<span class='Error'>" & errorMessage & "</span>")
End If
%>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td nowrap valign="top"></td>
<td id="submitknapp" style="visibility:visible;" width="100%" valign="top" class="Hierarchy" align="right"><input onclick="Layer()" border="0" src="images/btn_ok.gif" name="submit" type="image"></td><td><a href="organize.asp"><img border="0" src="images/btn_cancel.gif"></a></td>
</td>
</tr>
<tr>
<td colspan="3">
<div id="textlager" style="visibility:hidden;">Importerar bokmärken, var god vänta...</div>
</td>
</tr>
</table>