write pdf file to dataiku folder using python

jalkhonaifer
Level 1
write pdf file to dataiku folder using python

I am trying to write a pdf filer to dataiku folder.
usually I can write pdf file in my device with:
with open(outputFile, "wb") as outputStream:
output.write(outputStream)

but it doesnt work withing Dataiku
Also I tried to use this: 

with open(os.path.join('Folder Location', "file.pdf")) as outputStream:
output.write(outputStream)

and it gives this error as there is no file that exists there 

FileNotFoundError: [Errno 2] No such file or directory: 

Operating system used: windows

0 Kudos
1 Reply
Turribeach

First issue, Dataiku's dirty little secret: it doesn't actually create the folder in the file system until you put a file in it. Go to your flow and add a dummy file to the folder manually. 

Second issue you can't write directly to a Dataiku folder, use either upload_steam or upload_file:

https://developer.dataiku.com/latest/api-reference/python/managed-folders.html#dataiku.Folder.upload...