Comments
-
Akshata, no, the expected behavior is that files of all sizes work the same way. That said, I'm unable to reproduce the issue with a 13-byte file. When I try it, the file remains unchanged and not renamed: $ echo Hello, World | http post https://content.dropboxapi.com/2/files/upload Dropbox-Api-Arg:'{"path": "/test",…
-
Akshata, are you by chance uploading the exact same file content? If the content is unchanged, Dropbox essentially ignores the update, so the file doesn't get renamed. Make sure that you're uploading different content to test that rename works properly.
-
[Cross-linking with http://stackoverflow.com/questions/37453249/access-dropbox-account-for-users-without-creating-an-app-for-every-user-account on Stack Overflow.]
-
Your DBRestClient instance presumably went out of scope at the end of viewWillDisappear, so the object got deleted. Although you don't necessarily need it to be an instance variable on a UIViewController, it does need to be retained somehow. I should point out that the API you're using has been deprecated and will stop…
-
An alternative (drop both CURLOPT_POST and the Content-Type header): curl_setopt_array($ch, array( CURLOPT_URL => 'https://content.dropboxapi.com/2/files/download', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => array("Authorization: Bearer $accessToken", "Dropbox-API-Arg: $data"),…
-
Sorry, I think I steered you wrong. Your Content-Type header was fine... here's code that's working for me: $accessToken = '<REDACTED>'; $ch = curl_init(); $data = json_encode(array('path' => '/test.txt')); curl_setopt_array($ch, array( CURLOPT_URL => 'https://content.dropboxapi.com/2/files/download',…
-
What do you mean by "it returns nothing"? This part looks wrong: 'Content-Type: ', 'Authorization: Bearer ' . $key But in general, the API returns pretty clear error messages that tell you what is wrong with a request, so make sure you're able to read the HTTP response bodies even when an error occurs.
-
How about this so you can see the actual response body? } else { String responseBody = accountResponse.body().string(); // log or just inspect responseBody accountResponse.body().close(); return ERROR_RESPONSE_UNSUCCESSFUL; }
-
In fact, this header indicates there's a 163-byte response. You'll need to read that response to see what the error is. 6 = "Content-Length" 7 = "163"
-
"there's nothing in response body" This is very unlikely to be true. I don't think the Dropbox API ever returns a 400 response without a response body explaining the issue. Can you share the code you're using to read the response body?
-
I'm not 100% sure I understand your question, but does the force_reapprove parameter do what you want? (Try adding &force_reapprove=true to the /authorize URL.) See https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize for details.
-
Andrew, I'm not 100% sure without investigating, but I believe the login button is always disabled on initial page load. It's then enabled via JavaScript, but presumably something's failing before we get to that point on the browser you're using. Unless there's a specific security issue that we're mitigating, it's unlikely…
-
I'd definitely recommend using the v2 SDK. I don't expect there to be further updates to the v1 Android SDK, now that v2 exists. The v2 SDK is no longer in beta. (From https://github.com/dropbox/dropbox-sdk-java/blob/master/ChangeLog.txt, it looks like the first non-beta build was released in March.) The website needs to…
-
Skimming the source code, I actually don't think this is causing your issue, but I'd still recommend removing that line.
-
Could the problem be this line? request.RequestFormat = DataFormat.Json; Your request format is not JSON, and I wonder if that's causing RestSharp to try to convert the byte array to a string (yielding "System.byte []").
-
Out of curiosity, is there a reason you don't like IFTTT and Zapier's existing Dropbox support? (https://ifttt.com/dropbox and https://zapier.com/zapbook/dropbox/) I'm not sure if they use webhooks or not. Maybe you want to use something specific in the Dropbox webhook payload?
-
My guess is that something changed on the Dropbox side to redirect paths with double slashes in them. (E.g. /foo//bar gets redirect to /foo/bar.) I'll make sure the right folks take a look at this.
-
You mentioned uploadFileFromString, but it looks like the error is coming from createShareableLink? Also, I notice that the path you're passing to createShareableLink has an extra leading slash. My guess is that this is the culprit... try getting rid of that leading slash to see if the problem goes away.
-
disable_signup=true goes on your /authorize URL. E.g. https://www.dropbox.com/1/oauth2/authorize?...&disable_signup=true. See https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize. Your code for finding the access token will break if the parameters come in a different order.
-
A couple other issues I can spot: * Your code doesn't appear to ever call /upload_session/finish. You'll need to detect when you've uploaded the entire file and use that endpoint to close out the upload session. * A while loop can't work here. You need to wait for each call to /upload_session/append_v2 to complete before…
-
BTW, even after you sort out the typo, I think your code is wrong. From my reading of the RestSharp documentation, you want something like this: request.AddParameter("application/octet-stream", externalFile.FileBody, ParameterType.RequestBody); I'm assuming that externalFile.FileBody is something like a byte array. If not,…
-
Read the error message carefully: Error in call to API function "files/upload": Bad HTTP "Content-Type" header: "application/octet-stream;". Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".
-
No update. Could you clarify what exactly you want? You can store a .tar.gz file in Dropbox, but you need to create the file yourself. Dropbox doesn't support appending to existing files, so you would need to download the file, make your change, and then upload it again. Appending to a .tar.gz file doesn't make a lot of…
-
nwjs (formerly node-webkit) lets you set the domain of your app to whatever you want. See http://docs.nwjs.io/en/latest/References/Manifest%20Format/#domain. In short, add "domain": "domain-you-want" to your manifest.json, and then add "domain-you-want" as an allowed domain with your Chooser app. I did this and then found…
-
Your URL is wrong... it should be https://content.dropboxapi.com/2/files/upload. There may be other ways, but one way to post the content of a local file would be to read it into memory first. E.g., this worked for me: curl_setopt($ch, CURLOPT_POSTFIELDS, fread($f, filesize("test.txt")));
-
Your JSON needs to be encoded in a way that's compatible with HTTP headers. (E.g. "\u5272" instead of "割") What programming language are you using? The way to do this varies from language to language.
-
Cross-linking with http://stackoverflow.com/questions/37656680/create-folder-automatically-during-file-uploading-in-c-sharp-using-dropbox-core on Stack Overflow.
-
Please create other posts for your other questions.
-
To clarify, while the upload method is restricted to files with a maximum size of 150MB, Dropbox itself has no restrictions on the size of files uploaded and downloaded. If you're uploading files larger than 150MB, you'll need to use upload sessions (see the uploadSession* methods in the class Alexandra linked to above).