cancel
Showing results for 
Search instead for 
Did you mean: 

Copying file contents

zladuric
Champ on-the-rise
Champ on-the-rise
Hello,

I'm using Alfresco 3.0 community version, and I'm trying to copy the file content.
I was reading the wiki JavaScript API page (among others), and I got the idea that I can do
new_file.content = old_file.content
IBut when I do this, the result is not a proper pdf file.
Can somebody point to an example or give me the proper steps to do this?
2 REPLIES 2

invictus9
Champ in-the-making
Champ in-the-making
When you say "it is not proper PDF", does this mean the content is mangled? There are notes in the Javascript API to indicate that the .content property is really only usable for text files, and PDF files are not text files.

You might be able to use the writer() method to pass the content through without mangling. I haven't tried it yet.

zladuric
Champ on-the-rise
Champ on-the-rise
Yes, that is what I meant. It actually doesn't even become mangled, I just get one blank page.
Now, writer() sounds interesting, I'll have a look. Or just plain old orig_file.copy(destination) or whatever the syntax. Although Alfresco was complaining about some missing properties or something last time I used that.

Thanks anyway!