Name of file copied via UIPasteBoard is not kept
When I paste an .epub file in the Files App, if the file has been copied with Share/Copy, the file name is kept.
If the file has been copied with UIPasteboard, the file name becomes Publication.epub.
How could I keep the file name?
UIPasteboard=ObjCClass('UIPasteboard') pb=UIPasteboard.generalPasteboard() file_data = NSData.dataWithContentsOfFile_(path) pb.setData_forPasteboardType_(file_data, ns('org.idpf.epub-container'))