LikeThisName
Vendor
Project: Need to allow people to access files from intranet but only edit them from PCDOCS where changes are recorded.
Solution: CopyFile on the fly and have them open that, or preferably open file or copy in read-only format
Approach: Feel Free to question this)
Since I can't write to a temp folder on clients pc due to virus scanner, nor can can i overwrite temp file in intranet directory due to permissions, i wanted to increment the destFile and then I'll go from there. whether that's manually deleting the extra files every month or whatever
CODE: (INCREMENT DOESN'T SEEM TO WORK
LikeThisName <- ? Sorry It's Taken =)
Solution: CopyFile on the fly and have them open that, or preferably open file or copy in read-only format
Approach: Feel Free to question this)
Since I can't write to a temp folder on clients pc due to virus scanner, nor can can i overwrite temp file in intranet directory due to permissions, i wanted to increment the destFile and then I'll go from there. whether that's manually deleting the extra files every month or whatever
CODE: (INCREMENT DOESN'T SEEM TO WORK
Code:
<%
dim fso, sourceFile, destFile, i
Set fso = Server.CreateObject("Scripting.FileSystemObject")
sourceFile = "\\c_web\intranet\Modules\PSW\TESTING.doc"
destPath = "\\c_web\intranet\Modules\PSW\"
destFile = "MyTempFile.doc"
destFilePath = destPath & destFile
if fso.FileExists(destFile) then
destFile = destFile & "0"
i = 1
do while not fso.FileExists(destFilePath)
destFile= left(destFile,(len(destFile)-1)) & i
destFilePath = destPath & destFile
i=i+1
loop
end if
fso.CopyFile sourceFile,destFilePath,true
Set fso = Nothing
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<P><a href="./<%=destFile%>">open file</a></P>
</BODY>
</HTML>
LikeThisName <- ? Sorry It's Taken =)