Open Gorparth opened 3 years ago
Try File("")
doesn't seem to work, can you provide full function like aforementioned ?
Try item.file = onedrivesdk.File("")
. However this may be a limitation with the API you can't change. Have you tried googling it yet?
I used this item.file = Fil(""), and it is not giving error but when I'm adding this item(empty file) to the parent folder's childern list that time it is showing error that can not add item.
Therefore I was asking for full function like what would be the steps to create file, like I've used this but something is wrong.
path="/tmp.txt" item = onedrivesdk.Item() item.name = os.path.basename(path) item.size = 0 item.file = onedrivesdk.File("") client.item(path=os.path.dirname(path)).children.add(item)
i want to create new file using python, where we have to just give filename with an extension and blank file is created, I'm trying with item
path="/tmp.txt" item = onedrivesdk.Item() item.name = os.path.basename(path) item.size = 0 item.file = onedrivesdk.File() client.item(path=os.path.dirname(path)).children.add(item)
but this is giving error: onedrivesdk.error.OneDriveError: invalidRequest - Cannot create a file without content
and I want it to be of any extension. Please help