Upload billeder
HejProblem med asp script til uload af brugers info billdede til Phbirkerød.dk
Billedet bliver godt nok lagt i mappen. Men jeg får flg. fejlmeddelse.."
kopierer filen: D:\home\xnphbirkerdd8dzj\www\images\ph\3.jpg til thumbnail (lille billede)...
Microsoft VBScript runtime error '800a004c' Path not found /upload2."
På forhånd tak for Jeres hjælp..
Mvh
KIm'
her er upload2.asp::
<%@ LANGUAGE="VBScript" %>
<!-- #include file="protect.inc" -->
<!-- #include file="db.asp" -->
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=windows-1252">
<META NAME="keywords" CONTENT="">
<META NAME="description" CONTENT="">
<META NAME="author" CONTENT="Kim">
<META NAME="ROBOTS" CONTENT="ALL">
<LINK REV="made" href="mailto:">
<link rel="stylesheet" type="text/css" href="style/weblog.css">
<script type="text/javascript" language="JavaScript" src="javascript/weblog.js"></script>
<script language="JavaScript">
function checkKey() {
var key = window.event.keyCode;
if (key == 13) {
document.search.submit();
}
}
function checkFormatBillede1() {
str = document.upload.billede1.value.toUpperCase();
if (!(str.substring(str.length-3,str.length) == 'JPG')){
alert('Billedeformatet skal være .JPG'); }
}
function ShowProgress()
{
strAppVersion = navigator.appVersion;
if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "")
{
if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
{
winstyle = "dialogWidth=375px; dialogHeight:130px; center:yes";
window.showModelessDialog('<% = barref %>&b=IE',null,winstyle);
}
else
{
window.open('<% = barref %>&b=NN','','width=370,height=115', true);
}
}
return true;
}
</script>
</head>
<body onload="timer();">
<table border="0" width="100%" height="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" height="150">
</td>
</tr>
<tr>
<td height="15">
</td>
</tR>
<tr>
<td align="center" valign="top">
<table border="0" width="750" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" height="15">
<span lang="da" style="font-color:#c5c5c5; letter-spacing: -2; font-size:8pt"> >></span>
<span class="header"><span lang="da">Image upload</span>...</span>
</td>
</tr>
<tr>
<td height="9" style="padding-top: 0; padding-bottom: 0"><img src="images/bartop.gif" align="absbottom" width="750" height="9"></td>
</tr>
<tr>
<td>
<table class="tableMain">
<tr>
<td style="padding-left: 7;" width="70%" valign="top">
<!-- start text -->
<%
server.scriptTimeOut = 3600
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
Count = Upload.SaveVirtual("/images/ph/")
temp = session("dato")
response.write("Dit billed bliver nu uploadet til internettet ved hjælp af komponenten 'AspUpload3.0.0.3'<br><br>")
For Each File in Upload.Files
'Response.Write File.Name & "= " & File.Path & " (" & File.Size &" bytes)<BR><br>"
x = inStr(StrReverse(File.Path),"\")-1
filename = right(File.Path,x)
Response.Write " sti = " & File.Path & "<BR>"
Response.Write " filnavn = " & filename & "<BR>"
Response.Write " størelse = " & File.Size & " bytes<BR><br>"
Next
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
'Response.Write (" sourcefile: " & Server.Mappath("/images/ph/") & "\" & filename & "...<br><br>")
if FSO.FileExists(Server.Mappath("/images/ph/") & "\" & filename) Then
sourceFile = Server.Mappath("/images/ph/") & "\" & filename
Response.Write ("kopierer filen: " & sourceFile & " til thumbnail (lille billede)...<br><br>")
destFile = Server.Mappath("/images/ph/") & "\" & temp
'Response.Write ("kopierer filen: " & sourceFile & " til brug thumbnail (lille billede)...<br>")
fso.CopyFile sourceFile,destFile,true
'Response.Write (" copy file OKAY...<br><br>")
FSO.DeleteFile(Server.Mappath("/images/ph/") & "\" & filename)
'Response.Write ("sletter uplkopierer filen: " & sourceFile & " til brug thumbnail (lille billede)...<br>")
temp = replace(destfile,"x","t")
fso.CopyFile destfile,temp,true
set FSO = nothing
sub ResizeX(filnavn,intXSize)
Dim myimage
Set myimage = Server.CreateObject("aspimage.image")
myimage.Loadimage(filnavn)
Dim intYSize
intYSize = (intXSize / myImage.MaxX) * myImage.MaxY
response.write("Billedet: " & filnavn & " bliver nu ændret til " & intXsize & "x" & intYsize & "<br> " )
myimage.ResizeR intXSize, intYSize
myImage.Filename = filnavn
myImage.SaveImage
set myImage = nothing
end sub
'resize
Call ResizeX(destfile,700)
Call ResizeX(temp,150)
End If
Set FSO = nothing
%>
<!-- end text -->
<br>Billedet er tilføjet til din weblog !<br><br>
- <a href="default.asp">klik her for at vende tilbage til forsiden...</a><br><br>
- <a href="weblog.asp?id=<%= session("id") %>">klik her for at vende tilbage til webloggen...</a>
</td>
</tr>
</table>
<table border="0" width="750" style="border-collapse: collapse" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom" height="9" style="padding-top: 0; padding-bottom: 0" colspan="2"><img src="images/barbottom.gif" align="top" width="750" height="9">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" align="center" height="35">
</td>
</tr>
</table>
</body>
</html>