dropbox-php

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

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

Download file from dropbox to the server

二次信任 提交于 2020-01-14 04:56:06
问题 I want to download the files from dropbox and need to keep it in my server on behalf of dropbox user. I tried with curl and file_get_contents. But could not succeed. Should I need to use any api method of dropbox ? I could able to download the file from browser but I need to keep it in server. My application is a kind of file sharing. 回答1: The Dropbox browser client is developed to be used by the Registered Users only, where user needs to sign-in and then he can access files there. But as you

Missing CSRF token in session

泪湿孤枕 提交于 2020-01-07 05:49:05
问题 I am creating the application which can fetch the files and folder from the dropbox and will show in the web page.I have the below code. $appInfo=new Dropbox\AppInfo($dropboxKey,$dropboxSecret); //store CSRF token $csrfTokenStore = new Dropbox\ArrayEntryStore($_SESSION,'dropbox-auth-csrf-token'); $webAuth = new Dropbox\WebAuth($appInfo,$appName,'path',$csrfTokenStore); when i execute the code i got the below error: Fatal error: Uncaught exception 'Dropbox\WebAuthException_BadState' with

How to backup files from a specific directory to Dropbox using PHP only?

爱⌒轻易说出口 提交于 2019-12-30 05:23:36
问题 I would like to create a PHP script to backup files from a particular directory on my website to my Dropbox account. I tried to search for examples and how to work around it but I only found code to backup databases or to buy ready made solutions. This is the code I tried <?php $passw = "jason"; //change this to a password of your choice. if ($_POST) { require 'DropboxUploader.php'; try { // Rename uploaded file to reflect original name if ($_FILES['file']['error'] !== UPLOAD_ERR_OK) throw

Dropbox API - Get permanent link for my media?

倖福魔咒の 提交于 2019-12-23 12:42:07
问题 I use "createTemporaryDirectLink" method to get links for streaming my video. it works like a charm... but every time I need to update these links as they expire. I wonder whether there is a possibility to get and then keep permanent links for streaming media? Thanks 回答1: You might want to instead get a share link via createShareableLink and then convert it to a direct link by stripping the other query parameters and adding raw=1 . (See https://www.dropbox.com/help/201 for details on how to

Access dropbox api without clientside authentication?

泪湿孤枕 提交于 2019-12-23 09:17:00
问题 I'm trying to create a smooth solution for sharing files with a custom presentation of the files (logos fonts etc). My ideal would be to put the files in a dropbox folder and then have a webpage, on a separate server, access those files over javascript and display a list of them linked to the actual files. A demand is that the end user don't have to authenticate with a dropbox acocunt in order to access the files. I would rather like to use a public folder or use files from another account.

Retrieve contents of a public Dropbox folder?

僤鯓⒐⒋嵵緔 提交于 2019-12-20 12:43:19
问题 Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like: http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt One would think that jumping up one level to the directory in the URL... http://dl.dropbox.com/u/1234567/publikPholder/ ...would show all the public files. Nope. Nothing but a 404. 回答1: Looks like this library is pretty complete (although I haven't used it myself), and is

Retrieve contents of a public Dropbox folder?

☆樱花仙子☆ 提交于 2019-12-20 12:43:04
问题 Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like: http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt One would think that jumping up one level to the directory in the URL... http://dl.dropbox.com/u/1234567/publikPholder/ ...would show all the public files. Nope. Nothing but a 404. 回答1: Looks like this library is pretty complete (although I haven't used it myself), and is

Dropbox uploading within script

六月ゝ 毕业季﹏ 提交于 2019-12-17 18:29:28
问题 I have a form that allows a user to fill in several aspects and then choose a file to upload. When the form is submitted, I want write some code that saves the file to a dropbox account and gets access to a direct download link and places this in a database I am hosting. If anyone has done this, is there a specific section of the API to look at? Or any examples? I can't seem to find this in the API. Thanks. 回答1: From what I see in the API it is possible to do this. You need to download the