Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Same blobid/object name for all uploaded files from rest api(To save a file on server)

mohan yadav
Contributor
January 30, 2024 edited

Hi Guys,

I am able to Post/upload files in bitbucket cloud using rest api (https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-post) but it generate same blobid/object id/object name for all uploaded files. Can you please suggest me the solution , so on every upload of a file rest API should generate unique/different blobid/object name. I am referring bloblid/object name for below highlighted  RED area, i am getting same 7489acc for all uploaded files which is incorrect. I use "View raw commit" option to find it on bitbucket cloud url.
Capture.PNG

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 31, 2024

Hi Mohan and welcome to the community!

Can you please confirm if the files you are uploading have the same content?

If you pull these commits locally in a clone of a repo and then run

git show 7489acc

you will get the contents of the file.

Committing files with the same content will show you the same hash in the red-circled area from your screenshot. This is not specific to the API.

You can try the same locally with a git commit command in a clone of a repo, for testing purposes, i.e.:

  • commit a new file with the content "hello world"
  • commit a second new file with a different name, but with the same content "hello world"

Then run git show for each of the two commits created. The second hash in the index part of the output will be the same for both git show commands.

Kind regards,
Theodora

mohan yadav
Contributor
February 27, 2024

Thanks, it was my bad, file content was same.

Like Sabine Mayer likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2024

You are welcome, Mohan. Please feel free to reach out if you ever need anything else!

Like 2 people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events