将文件堆栈中上传的 URL 存储到 mysql 数据库中

store the URL of an upload in filestack into a mysql database

我最近注册了 filestack,我发现理解他们的文档有点困难。

我已经在我的网站上添加了 javaascript 插件。但是我只是想知道您是否真的可以将上传文件的 URL 存储到 mysql 数据库中?

Just not sure what the next step is to actually get the URL of the file the person just uploaded

请看这个例子:https://jsfiddle.net/1fLjbrwr/1/

client.pick({
  accept: 'image/*',
}).then(function(result) {
  // file url (plus mimetype, size and more)
  // can be found inside the result object
  console.log(result);
  console.log("File url: " + result.filesUploaded[0].url);
});

上传文件时,您可以使用回调函数来处理响应。

您还可以使用在上传过程中的不同点调用的内置回调函数之一(此处提供文档:https://www.filestack.com/docs/javascript-api/pick-v3):

client.pick({
  accept: 'image/*',
  onFileUploadFinished: function(file) {
    // this will be called when file is uploaded
    console.log(file);
  }
})