You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I am trying to upload a file to my private repository.
I have read:
https://stackoverflow.com/questions/20302524/upload-file-to-bitbucket-via-php-script
App password is created.
this is my code:
$file_git = "test.jpg";
$data_string_git = [ 'files' => curl_file_create($file_git),];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.bitbucket.org/2.0/repositories/USERNAME/REPO/src/".urlencode("test.jpg"));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string_git);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME:APP_PASS");
curl_setopt($ch, CURLAUTH_BASIC, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
I am not sure should I specify additional data for the commit for example and author.
Can you please let me know where is the problem?
thank you
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events