When I use SaveUserBinaryRecord, the result is strange

Hi,When I use this method, the binary_info is empty, I don’t know the url, there is no way to upload binary.


I don’t know what the problem is, can you help me? Thank you very much!

Hello @user13,

Our team has discussed your inquiry internally and will respond to this thread shortly to address your question. Thank you for your patience!

Hello @user13

Thank you for reporting this, we will deliver the fixes as soon as possible.
We are sorry for this inconvenience.

We returned incorrect type for that interface.

Hi @user13,

While we are in-progress fixing this, Could you try this workaround? you could use the Modify binary record flow:

  1. Save binary record key
  2. Request Pre-sign URL
  3. Upload binary file
  4. Commit the changes

Please let us know if you need more help.
We are sorry for this inconvenience.

yes, I got another question:The server rejected the upload



thank you

Hi @user13,

We apologize for the delayed response. Our service automatically pre-signs the S3 upload link with the file’s content type, which you can find in the content_type field of the Request pre-sign URL endpoint response. So, we should use this value as the Content-Type header when uploading the file.

I’ve noticed a constraint within our Upload utility, where it defaults to sending application/octet-stream as the content type header. This may cause issues if your file has a different content type, such as image/png.

We’re currently reviewing this with our SDK team to determine if this is an intended limitation or if enhancements are possible. In the meantime, could you temporarily set the file type to bin when Requesting pre-sing URL? This will align the content type with application/octet-stream.

We apologize for any inconvenience this may have caused and appreciate your understanding.

hi @user13
In case you still unable to upload your png, you could try using this implementation. It utilizes AccelByteNetUtilities.UploadTo instead of AccelByteNetUtilities.UploadBinaryTo method. Please note that:

  • When calling RequestUserBinaryRecordPresignedUrl, assign the fileType from your file extension, in this case it is png.
  • When calling UploadTo, assign the contentType based on result from RequestUserBinaryRecordPresignedUrl, in this example binaryInfo.ContentType
  • By using this utility, the data would be converted into base64 string before uploading.

hi @user13
New Unity SDK has been released to add an optional parameter ContentType to AccelByteNetUtilities.UploadBinaryTo, with default value application/octet-stream.
Please find the new versions here:

I attached sample code on how to upload binary to the cloud save service using the new upload utility.
UploadBinaryExample.txt (2.1 KB)

Please let us know if you need more help.