Przeglądaj źródła

Add meta.relativePath explicit example (#2106)

* Add meta.relativePath explicit example

Spent hours to test it to add a relativePath and non unique ids for files with the same name but coming from different folders.

It works like it but it's confusing with the `setMeta` method.

* tweak comment

Co-authored-by: Renée Kooi <renee@kooi.me>
Clement Fradet Normand 5 lat temu
rodzic
commit
59e658e983
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      website/src/docs/uppy.md

+ 4 - 0
website/src/docs/uppy.md

@@ -374,6 +374,10 @@ uppy.addFile({
   name: 'my-file.jpg', // file name
   type: 'image/jpeg', // file type
   data: blob, // file blob
+  meta: {
+    // optional, store the directory path of a file so Uppy can tell identical files in different directories apart
+    relativePath: webkitFileSystemEntry.relativePath,
+  },
   source: 'Local', // optional, determines the source of the file, for example, Instagram
   isRemote: false // optional, set to true if actual file is not in the browser, but on some remote server, for example, when using companion in combination with Instagram
 })