I would like to use this method to get the byte information from a document based on its URL so that I can copy it to a new location.
I have only seen examples using file.OpenBinary(); where file is simply used within a foreach loop through all the files in a library. I have a list that I use as a sort of "queue" which adds an item with its source url in one column and the destination url in another. How can I essentially do something like:
file = "mysite.com/file2.docx"
byte[] myFile = file.OpenBinary();
SPFile copiedFile = someLibrary.Add(System.IO.Path.GetFileName(file.Url), myFile);
Is this possible?