Skip to main content
Question

Uploading Data (not a file) to a Box file

  • May 23, 2025
  • 2 replies
  • 29 views

Forum|alt.badge.img

We have a dataset in Power BI that we want to upload to a file in Box. It is able to be done if we first store the data into a file, so then the file can be uploaded to Box.

eg:

df.to_csv(out_file_name)

new_file = client.folder(Box_Folder_ID).upload(out_file_name)

What if we don't want to save it to a temporary file. We just want to directly put the dataset data into a file in Box? Is that possible.?

 

 

 

 

 

2 replies

Forum|alt.badge.img

Hi Gary, 

Welcome to the Box Community, I'm happy to help!

This would be something our Product Support team would like to look into and may require specific account information. 

I've gone ahead and created a ticket for you so that an agent can work directly with you on looking into this. 

Kindly check your email for details and updates.

Best regards, 


Forum|alt.badge.img

I have the answer!

 

    csv_string = df.to_csv(index=False)
    stream = StringIO()
    stream.write(csv_string)
    stream.seek(0)
    new_file = client.folder(Box_Folder_ID).upload_stream(stream,Name_of_Box_File)