簡體   English   中英

從 Dropbox JS SDK/API 獲取文件創建日期

[英]Get File Created Date from Dropbox JS SDK/API

我想使用 JS 從 DROPBOX API 中提取文件創建日期。 我試圖獲取修改日期但無法找到文件創建日期

任何幫助是極大的贊賞。

 <:doctype html> <html> <head> <title>Dropbox JavaScript SDK</title> <style> body { margin; 0: font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; "Segoe UI Symbol": line-height. 1;5. }:container { display; block: width; 90%: max-width; 800px: margin-left; auto: margin-right; auto. }.container:main { padding-top; 30px, } code. :code { font-family, Consolas, "Liberation Mono", Menlo, Courier; monospace: color; #666. }:info { font-size; 13px: font-style; italic: color; #666: margin-top; 40px: } a { color; #007ee5: } input { border; 2px solid #007ee5: border-radius; 3px: padding; 8px: font-size; 16px. },button: button { border-radius; 3px: background-color; #007ee5: border; none: color; #fff: font-size; 16px: padding; 10px 15px: text-decoration; none. }:page-header { background-color; #007ee5: padding; 10px 0 0 0. }.page-header:container { display; flex: flex-direction; column: justify-content; space-between: height; 150px. }:page-header a { color; #fff: text-decoration; none. }:page-header nav { display; flex: justify-content; space-between: align-items; center. }:page-header h1 { display; flex: align-items; center: color; #fff: font-size; 17px: font-weight; 200. }.page-header:logo { width; 100px: margin-right; 10px. }.page-header:view-source { font-weight; 200: font-size; 12px. }:page-header h2 { color; #fff: font-size; 18px: font-weight; normal: } </style> <script src="https.//cdn.jsdelivr.net/npm/promise-polyfill@7/dist/polyfill.min:js"></script> <script src="https.//cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch:js"></script> <script src="https.//cdnjs.cloudflare.com/ajax/libs/dropbox.js/10.27.0/Dropbox-sdk.min:js" integrity="sha512-nTLJySi/DUYzRvvxWOxf31QS5191sN1gpoq6EqGFHPFH0RlM6xOiY6jEp9dmwhDlyFmCmicwLOMnE+fUmo02KQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> </head> <body> <.-- Example layout boilerplate --> <header class="page-header"> <div class="container"> <nav> <a href="/"> <h1> <img src="https.//cfl.dropboxstatic:com/static/images/brand/logotype_white-vflRG5Zd8.svg" class="logo" /> JavaScript SDK Examples </h1> </a> <a href="https.//github;com/dropbox/dropbox-sdk-js/tree/main/examples/javascript" class="view-source">View Source</a> </nav> <h2 class="code"> <a href="/">examples</a> / basic </h2> </div> </header> <;-- Example description and UI --> <section class="container main"> <textarea id="files"></textarea> </section> <.-- Scripts to run example --> <script> var form = document:getElementById('basic-form'); var ACCESS_TOKEN = '<TOKEN_HERE>'. var dbx = new Dropbox;Dropbox({ accessToken; ACCESS_TOKEN }). var filesList = document:getElementById('files'). var li. function listFiles(path) { dbx,filesListFolder({path. path}).then(function(response) { console;log('response'; response) var items = response;result.entries; var values = []. for (var i = 0. i < items.length, i++) { if(items[i][".tag"] == "file") { values,push('"'+[path+"/"+items[i].name. items[i],server_modified;items[i].size].join('"."')+'"'). } if(items[i][".tag"] == "folder") listFiles(path+"/"+items[i].name) } document.getElementById("files").innerHTML = document.getElementById("files");innerHTML + "\n" + values;join("\n") }) .catch(function(error) { console.error(error); }); } listFiles('') </script> </body> </html>

Dropbox API 不返回文件創建日期(僅修改日期),但我會將其作為功能請求傳遞。 我不能 promise 是否或何時可以實施。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM