Jeg er temmeligt fucked og træt af dette script så nu poster jeg hele dynen.
Jeg skal bare gemme filen som produkt_id&request("location")&".jpg"
HÅBER DU KAN HJÆLPE.....
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Conn/ttt.asp" -->
<%
Dim rs_produkt_id__MMColParam
rs_produkt_id__MMColParam = "NULL"
If (Request.QueryString("produkt_id") <> "") Then
rs_produkt_id__MMColParam = Request.QueryString("produkt_id")
End If
%>
<%
Dim rs_produkt_id
Dim rs_produkt_id_numRows
Set rs_produkt_id = Server.CreateObject("ADODB.Recordset")
rs_produkt_id.ActiveConnection = MM_bst_STRING
rs_produkt_id.Source = "SELECT * FROM produkt WHERE produkt_id = " + Replace(rs_produkt_id__MMColParam, "'", "''") + ""
rs_produkt_id.CursorType = 0
rs_produkt_id.CursorLocation = 2
rs_produkt_id.LockType = 1
rs_produkt_id.Open()
rs_produkt_id_numRows = 0
%>
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
'Upload.IgnoreNoPost = True
' Upload files
'Upload.OverwriteFiles = False ' Generate unique names
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.save "c:\www\domain.dk\www\kunder\ttt\billeder\"
DIM file
' hent og sæt begge billeder til deres nuværende.
thefile = (rs_produkt_id.Fields.Item("produkt_id").Value) & request.QueryString("location") & "jpg"
Upload.ExtractFileName(thefile)
' Databaseforbindelse - husk at angive sti til din database
Set Conn = Server.CreateObject("ADODB.connection")
Conn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=c:\www\domain.dk\www\kunder\ttt\db\ttt.mdb"
Conn.Open
%>
<HTML>
<HEAD>
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}
#barbackground{
background-color:black;
}
-->
</style>
<script language="JavaScript1.2">
/*
Dynamic Progress Bar- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit
http://www.dynamicdrive.com*/
//1) Set the duration for the progress bar to complete loading (in seconds)
var duration=5
//2) Set post action to carry out inside function below:
function postaction(){
//Example action could be to navigate to a URL, like following:
//window.location="
http://www.dynamicdrive.com"<% if request.QueryString("location") = "v" then %>
window.opener.document.images['pict_v'].src = '<%="
http://www.domain.dk/kunder/ttt/billeder/" & file_v %>';
<%end if%>
<% if request.QueryString("location") = "h" then %>
window.opener.document.images['pict_h'].src = '<%="
http://www.domain.dk/kunder/ttt/billeder/" & file_h %>';
<%end if%>
self.close();
}
///Done Editing/////////////
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}
window.onload=initializebar
</script>
</HEAD>
<body>
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
}
</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
</body></html>
<%
rs_produkt_id.Close()
Set rs_produkt_id = Nothing
%>