Dropbox uploading within script

前端 未结 2 600
臣服心动
臣服心动 2020-12-09 06: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

2条回答
  •  执笔经年
    2020-12-09 06:59

    There is section in the Core API manual, see this link. So you can use the upload part like this:

    $f = file_get_contents('data.txt');
    $result = $dbxClient->uploadFile("/data.txt", dbx\WriteMode::add(), $f);
    
    echo 'file uploaded';
    

提交回复
热议问题