Hello NeilWang, I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept" the answer. Accepted answers show up at the top, resulting in improved discoverability for others.
Issue: You can use the Java SDK to interact with Azure File Share programmatically, such as uploading and downloading files. To access the file share, you need to provide a SAS token. However, customer is encountering an error when trying to upload a file to the file share using the upload() method of the BlobClient class. The error message looks like this:
Status code 400, "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.
RequestId:9d7f6931-701a-006b-4895-b5f8d3000000
Time:2024-06-03T09:04:42.4658381ZContent-Length24
Cause: Customer was using incorrect SDK.
Solution: Customer used the correct SDK for File Share i.e., azure-storage-file-share
which fixed the issue.