Forums

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

How can i create folder and upload file to it using CURL command

Riya Kondody April 14, 2019
I need to dynamically create folder and upload a mark down file to it using node js. I can imvoke curl command from node js. So please share curl command for it

2 answers

0 votes
Riya Kondody April 16, 2019

This worked fine for me. Thanks a lot

0 votes
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2019

Hi @Riya Kondody ,

If you are running Bitbucket Server, then please make sure are able to edit files from Bitbucket's UI, if not, you could check if property "feature.file.editor" can be set to "true", as described in https://confluence.atlassian.com/bitbucketserver058/bitbucket-server-config-properties-947168200.html as this will allow you to add code to a repository using cURL command PUT on http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*}

In Bitbucket Cloud, you could make use of https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src

Kind regards,
Rafael

Riya Kondody April 15, 2019

Hi,  am using api.bitbucket.org. how will I specify folder and file path in api call

Riya Kondody April 15, 2019

Folder Name as Test and file as text.md. Can you share am example with this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events