-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create empty file of any extension ?? #191
Comments
Try |
doesn't seem to work, can you provide full function like aforementioned ? |
Try |
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" |
Let me say that again:
|
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
The text was updated successfully, but these errors were encountered: