I have a PowerShell script that is used for transferring XML and PDF files. For both types of files, it performs the following operations separately:
- Copies files (
\*.pdf
) from remote folder A
to local folder X
via session.GetFiles
- Copies files (
\*.pdf
) from remote folder A
to local folder TEMP
via session.GetFiles
. After copying, files in folder A
are deleted (because the parameter remove
is set to true
)
- Copies files (
\*.pdf
) from local folder TEMP
to remote folder B
via session.PutFiles
. After copying, files in folder TEMP
are deleted (because the parameter remove
is set to true
)
Same operation is performed for XML files, too. For both file types, I use the same
TEMP
folder.
Basically steps 2 and 3 combined perform a move operation (There is probably a better solution for this, I know, but it works for me for now.)
When I run the script, the files are transferred successfully without a problem. There is no problem with the XML's, but when I try to view the PDF files that are transferred, I get a blank page saying
"There was an error processing a page. Invalid colorspace". I tried viewing on different browsers and in my local disk, but that did not help.
One of the things I am suspecting is, that the file format might be messed up during the transfer, possibly because of some parameter in
GetFiles
/
PutFiles
. I looked but could not find an answer. I would appreciate any suggestion as to why this might have happened.