question

Matthew Harmon avatar image
Matthew Harmon asked

Don't understand how to use InitiateFileUploads

Hi,

I am trying to upload a file for each user. In Windows it has a c:\[path to file]\file.json.

When I use "InitiateFileUploads" it doesn't seem to like the colon in the path. What's the base path I need to use to locate the file I want to use? Will need this on iOS and Android too, what's the base root path I use for those too?


Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

You can check this QuickStart, especially this section -- Entity files. As the documentation shows, you needn’t pass the file’s path to the API InitiateFileUploads. This API is used to initiate a file upload, you need to define file names and fill names in the field “FileNames”, such as “profile_configuration”. If you called this API successfully, it would return the “UploadUrl” to you, you need to upload the file using PUT request to this URL. In the example code, we used Encoding.UTF8.GetBytes to convert a string to the bytes, then upload it as a file. Assuming you are using the Unity, If you want to upload a file in the OS’s file management, please check the corresponding documents of Unity and C#.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.