|
Account Access
|
<%
function CopyFile(strFileSource, strFileDestination)
set fso = Server.CreateObject("Scripting.FileSystemObject")
if strError = "" then
Set f2 = fso.GetFile(strFileSource)
f2.Copy(strFileDestination)
Set f2 = nothing
end if
Set fso = nothing
end function
Dim LaunConn
Dim CookCartID
Dim objFSO
Set LaunConn=Server.CreateObject("ADODB.Connection")
LaunConn.Open "DSN=LaundryCarts;"
CookCartID = Session("CookCartID")
CustID = Session("CustID")
%>
|
Copy
Image |
<%if request.querystring("c") <> "1" then%>
<%else%>
<%
imagename = request.form("sourcepart")
if instr(ucase(imagename), ".JPG") = 0 then
imagename = imagename & ".JPG"
end if
imagedest = request.form("destpart")
if instr(ucase(imagedest), ".JPG") = 0 then
imagedest = imagedest & ".JPG"
end if
imagepath = server.mappath("../../images" & "/" & imagename)
destpath = server.mappath("../../images" & "/" & imagedest)
if request.form("sourcepart") = "" then
errortext = errortext & "No Source Part Specified "
end if
if request.form("destpart") = "" then
errortext = errortext & "No Destination Part Specified "
end if
set filetest = Server.CreateObject("Scripting.FileSystemObject")
if Not filetest.FileExists(imagepath) AND instr(errortext, "No Source Part Specified") = 0 then
errortext = errortext & "Source file " & imagepath & " does not exist "
end if
if filetest.FileExists(destpath) AND request.form("destpart") <> "" AND request.form("overwrite") <> "true" then
errortext = errortext & "Destination file " & destpath & " already exists "
end if
if errortext = "" then
response.write "Copying FROM " & imagepath & "
"
response.write "Copying TO " & destpath & "
"
Call CopyFile(imagepath, destpath)
response.write "Image copied! Click here to return to the image copying page."
else
response.write "The system cannot copy the file for the following reason(s).
"
Response.write "" & errortext & ""
end if
%>
<%end if%>
Return
to Menu |
|
|
|
|
|
|