My application fails after creating the first directory, then copying a file into to it, then creating another directory and trying to copy another file into it.
I have tried with 2 files in the first diretory and again it fails on the second file.
Really not sure why it's failing, but here is the code and console output
[pre]
for x = 0 to ubound(ftpinvoices,2)-2
set fs=Server.CreateObject("Scripting.FileSystemObject")
If Not fs.FolderExists(temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\") then
set f=fs.CreateFolder(temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\")
f.Attributes = 0
end if
do while bu = mid(ftpinvoices(0,x),39,instr(39,ftpinvoices(0,x),"\",0)-39)
invoice = ftpinvoices(0,x)&ftpinvoices(1,x)
fromfile = invoice
response.write("from="&fromfile&VbCrLf)
tofile = temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\"
response.write("to="&tofile&VbCrLf)
fs.CopyFile fromfile,tofile,True
objTextFile.WriteLine "put " & chr(34)&invoice&chr(34)
x=x+1
if x > ubound(ftpinvoices,2)-2 then
exit do
end if
loop
bu = mid(ftpinvoices(0,x),39,instr(39,ftpinvoices(0,x),"\",0)-39)
set fs=nothing
next[/pre]
And the console output
[pre]
from=C:\Users\me\Google Drive\Invoicing\DUCK-Duck-n-Roll\Flourish\INV-2014-11-09-44529-po-DUCK00216.pdf
to=C:\inetpub\ Drive\Invoicing\HOLACG-Covent Garden\Brakes\Inv-2014-11-15-9224697868-po-HPCG04.pdf
to=C:\inetpub\ <font face="Arial" size=2>
<p>Microsoft VBScript runtime </font> <font face="Arial" size=2>error '800a0046'</font>
<p>
<font face="Arial" size=2>Permission denied</font>
<p>
<font face="Arial" size=2>/doshiweekly.asp</font><font face="Arial" size=2>, line 265</font>
[/pre]
The code is selection files with particular date ranges and copying them to another directory.
I cannot see why it would create a directory and copy a file into to it, then create the second directory and fail copying the next file. I have checked all the permissions of the source files, and the target directory, and everything looks fine.
Any help greatly welcome.
Pete
I have tried with 2 files in the first diretory and again it fails on the second file.
Really not sure why it's failing, but here is the code and console output
[pre]
for x = 0 to ubound(ftpinvoices,2)-2
set fs=Server.CreateObject("Scripting.FileSystemObject")
If Not fs.FolderExists(temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\") then
set f=fs.CreateFolder(temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\")
f.Attributes = 0
end if
do while bu = mid(ftpinvoices(0,x),39,instr(39,ftpinvoices(0,x),"\",0)-39)
invoice = ftpinvoices(0,x)&ftpinvoices(1,x)
fromfile = invoice
response.write("from="&fromfile&VbCrLf)
tofile = temp_folder&"\ftpfiles\Weekending-" & isodate(nextupload,true)&"\"& replace(bu," ","-")&"\"
response.write("to="&tofile&VbCrLf)
fs.CopyFile fromfile,tofile,True
objTextFile.WriteLine "put " & chr(34)&invoice&chr(34)
x=x+1
if x > ubound(ftpinvoices,2)-2 then
exit do
end if
loop
bu = mid(ftpinvoices(0,x),39,instr(39,ftpinvoices(0,x),"\",0)-39)
set fs=nothing
next[/pre]
And the console output
[pre]
from=C:\Users\me\Google Drive\Invoicing\DUCK-Duck-n-Roll\Flourish\INV-2014-11-09-44529-po-DUCK00216.pdf
to=C:\inetpub\ Drive\Invoicing\HOLACG-Covent Garden\Brakes\Inv-2014-11-15-9224697868-po-HPCG04.pdf
to=C:\inetpub\ <font face="Arial" size=2>
<p>Microsoft VBScript runtime </font> <font face="Arial" size=2>error '800a0046'</font>
<p>
<font face="Arial" size=2>Permission denied</font>
<p>
<font face="Arial" size=2>/doshiweekly.asp</font><font face="Arial" size=2>, line 265</font>
[/pre]
The code is selection files with particular date ranges and copying them to another directory.
I cannot see why it would create a directory and copy a file into to it, then create the second directory and fail copying the next file. I have checked all the permissions of the source files, and the target directory, and everything looks fine.
Any help greatly welcome.
Pete