dropbox-api

Error in path with django-storages with dropbox

蹲街弑〆低调 提交于 2021-01-29 11:41:47
问题 This is my settings code DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage' DROPBOX_OAUTH2_TOKEN = "my token" DROPBOX_ROOT_PATH = "Apps/Djangoproject" The error i am getting while uploading a image: ValidationError: did not match pattern '(/(.|[\r\n])|id:.)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)' how to solve this issue? Anyone know how to solve this issue? 回答1: You're supplying a path of "Apps/Djangoproject" , and the error is indicating that it does not match the expected path

shell_exec causes infinite loop

淺唱寂寞╮ 提交于 2021-01-29 02:11:58
问题 I have a problem with shell_exec. I try to run the other php file in a separate thread, according to this answer: https://stackoverflow.com/a/222445/1999929 I have this very-very simple code: <?php $realpath = realpath("./second.php"); file_put_contents("./log.txt","\nFirst php running!\n",FILE_APPEND); shell_exec("php $realpath > /dev/null 2>/dev/null &"); ?> I need this because i want to use this file for a dropbox webhook link, and it has to give a response in 10 seconds, while processing

Upload a file into dropbox folder

依然范特西╮ 提交于 2020-06-28 04:59:16
问题 I have tried this to upload a file from a folder in my desktop to a folder in dropbox account. but each time i have uploaded an empty file through this code. How it is possible? Below s my code: $ch = curl_init(); $TOKEN = "asasasa";//token here $url = 'https://content.dropboxapi.com/2/files/upload'; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST, 1); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); $headers = array(); $headers[] = 'Accept: application/json'; $headers[] =

Uploading file to dropbox using Dropbox's v2 API

℡╲_俬逩灬. 提交于 2020-03-23 06:07:28
问题 I want to save an uploaded file in Dropbox using PHP and also use Dropbox's v2 API for this. I'm not getting any response for this. Below is my code. <?php $filename = 'qw.txt'; $api_url = 'https://content.dropboxapi.com/2/files/upload'; //dropbox api url $token = '<REDACTED>'; // oauth token $headers = array('Authorization: Bearer '. $token, 'Content-Type: application/octet-stream', 'Dropbox-API-Arg: '. json_encode( array( "path"=> '/'. basename($filename), "mode" => "add", "autorename" =>

Dropbox Api v2 - confusion with cursor and paging for list_folders

烈酒焚心 提交于 2020-01-25 05:12:04
问题 The files/list _folders method in api docs has the following for the description of the cursor parameter: cursor - Pass the cursor into list_folder/continue to see what's changed in the folder since your previous query. has_more - If true, then there are more entries available. Pass the cursor to list_folder/continue to retrieve the rest. https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder Which is it then? If I make another request to list_folders_continue

using dropbox as a server for my django app

喜夏-厌秋 提交于 2020-01-23 05:48:27
问题 I dont know if at all i make any sense, but this popped up in my mind. Can we use the 2gb free hosting of dropbox to put our django app over there and do some hacks to run our app? 回答1: The point you need to understand is: can you run django without djagno installed? Can django be installed on a usb-drive? Dropbox is but a cloud storage service NOT cloud hosting service. To store you do not require RAM and processors while for hosting you do. Hence the answer is NO. If you are okay with

Storing API keys in Android, is obfustication enough?

為{幸葍}努か 提交于 2020-01-22 18:47:09
问题 I'm using the Dropbox API. In the sample app, it includes these lines: // Replace this with your consumer key and secret assigned by Dropbox. // Note that this is a really insecure way to do this, and you shouldn't // ship code which contains your key & secret in such an obvious way. // Obfuscation is good. final static private String CONSUMER_KEY = "PUT_YOUR_CONSUMER_KEY_HERE"; final static private String CONSUMER_SECRET = "PUT_YOUR_CONSUMER_SECRET_HERE"; I'm well aware of the mantra

Storing API keys in Android, is obfustication enough?

廉价感情. 提交于 2020-01-22 18:46:07
问题 I'm using the Dropbox API. In the sample app, it includes these lines: // Replace this with your consumer key and secret assigned by Dropbox. // Note that this is a really insecure way to do this, and you shouldn't // ship code which contains your key & secret in such an obvious way. // Obfuscation is good. final static private String CONSUMER_KEY = "PUT_YOUR_CONSUMER_KEY_HERE"; final static private String CONSUMER_SECRET = "PUT_YOUR_CONSUMER_SECRET_HERE"; I'm well aware of the mantra

Dropbox Datastore to API 2 Migration Error

邮差的信 提交于 2020-01-22 02:06:53
问题 I'm trying to provide a way in my iOS app to migrate existing Datastore users to a new means of storing an SQLite database file on Dropbox via the new v2 API (SwiftyDropbox). I'm currently trying to let them connect to Dropbox with the old Datastore API with: let accountManager = DBAccountManager.init(appKey: "...", secret: "...") DBAccountManager.setSharedManager(accountManager) DBAccountManager.sharedManager().linkFromController(self) I am then taken to the Dropbox app on my phone where I

Dropbox Core API for file uploads

拈花ヽ惹草 提交于 2020-01-17 13:49:10
问题 I run a service that is visited by its users to generate PDF documents that are then delivered to them by email. I am in the process of exploring an alternative delivery route - popping the prepared document directly in a Dropbox folder that they designate. After a spot of research I discovered the Dropbox API and then played with their "explorer" here. Examining the cURL they generate to perform a file upload I found that it could quite easily be done with a spot of PHP. After creating a new