[英]How to upload files from web client (HTML/jQuery form) to your Dropbox folder
I have a web page with a form. 我有一个带有表单的网页。 I want the user to upload file to a Dropbox folder and get the download link.
我希望用户将文件上传到Dropbox文件夹并获得下载链接。 Also I don't want the form to ask the user for authentication in order to upload the file.
另外,我不希望表单要求用户进行身份验证才能上载文件。
How can I do this? 我怎样才能做到这一点?
I registered an App for this purpose and read the Api documentation, but it seems to me to complicated and can't even start. 我为此目的注册了一个应用程序,并阅读了Api文档,但是在我看来,它很复杂,甚至无法启动。
Dropbox website has a pretty good rundown of what you're trying to do in php: https://www.dropbox.com/developers/core/start/php Dropbox网站对您要使用php进行的操作提供了很好的总结: https : //www.dropbox.com/developers/core/start/php
You can use an html form on your website that POSTs to a php page. 您可以在网站上使用html表单来发布到php页面。
There should be plenty of available guides on the internet for setting up a form that saves the file on to your server using php/forms. 互联网上应该有很多可用的指南,用于设置使用php / forms将文件保存到服务器上的表单。 You then just need to redirect the file to your Dropbox, using their API.
然后,您只需要使用其API将文件重定向到您的Dropbox。
"Also I don't want the form to ask the user for authentication in order to upload the file." “此外,我也不希望表单要求用户进行身份验证才能上载文件。”
You certainly can't upload files into a user's Dropbox without that user's permission. 当然,未经该用户许可,您不能将文件上传到该用户的Dropbox中。
The Saver is the closest to what you want in terms of allowing a user to save a file to Dropbox without having to authorize your app, but you won't get back a link to the file. 在允许用户无需授权您的应用程序的情况下,将文件保存到Dropbox方面,该保护程序与您想要的最接近,但您不会找回该文件的链接。
The Chooser also does something like this, which is to give the user the option of uploading a file to Dropbox before then choosing it. 选择器还执行类似的操作,这使用户可以选择先将文件上传到Dropbox,然后再选择它。 You could instruct the user to upload a file to Dropbox in the Chooser and then select it.
您可以指示用户将文件上传到Chooser中的Dropbox,然后选择它。 After that, your app can get back a link to the uploaded file.
之后,您的应用可以获取到上传文件的链接。 You can try this out yourself in the Chooser demo and see if it meets your needs.
您可以在Chooser演示中自己尝试一下,看看它是否满足您的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.