We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello. Thanks for your script. I tried convert dropbox api examples and got bug.
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
curl -X POST https://content.dropboxapi.com/2/files/upload \ --header "Authorization: Bearer <get access token>" \ --header "Dropbox-API-Arg: {\"path\": \"/Homework/math/Matrices.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" \ --header "Content-Type: application/octet-stream" \ --data-binary @local_file.txt
And we got:
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://content.dropboxapi.com/2/files/upload"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $post = array( "file" => "@" .realpath("local_file.txt") ); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = "Authorization: Bearer <get access token>"; $headers[] = "Dropbox-Api-Arg: {\"path\": \"/Homework/math/Matrices.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}"; $headers[] = "Content-Type: application/octet-stream"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close ($ch);
Error in postfilds. Correct variant:
postfilds
curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents(local_file.txt));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello. Thanks for your script.
I tried convert dropbox api examples and got bug.
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
And we got:
Error in
postfilds
. Correct variant:The text was updated successfully, but these errors were encountered: