Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4888954
D10852.id36220.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10852.id36220.diff
View Options
diff --git a/native/media/encryption-utils.js b/native/media/encryption-utils.js
--- a/native/media/encryption-utils.js
+++ b/native/media/encryption-utils.js
@@ -289,7 +289,10 @@
async function decryptMedia(
blobURI: string,
encryptionKey: string,
- options: { +destination: 'file' | 'data_uri' },
+ options: {
+ +destination: 'file' | 'data_uri',
+ +destinationDirectory?: string,
+ },
): Promise<{
steps: $ReadOnlyArray<DecryptFileStep>,
result: DecryptionFailure | { success: true, uri: string },
@@ -378,7 +381,8 @@
// blobURI is a URL, we use the last part of the path as the filename
const uriSuffix = blobURI.substring(blobURI.lastIndexOf('/') + 1);
const filename = readableFilename(uriSuffix, mime) || uriSuffix;
- const targetPath = `${temporaryDirectoryPath}${Date.now()}-${filename}`;
+ const directory = options.destinationDirectory ?? temporaryDirectoryPath;
+ const targetPath = `${directory}${Date.now()}-${filename}`;
try {
await commUtilsModule.writeBufferToFile(targetPath, decryptedData.buffer);
} catch (e) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 12:57 PM (8 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3328524
Default Alt Text
D10852.id36220.diff (1 KB)
Attached To
Mode
D10852: [native] add decryptMedia() param to specify destination directory
Attached
Detach File
Event Timeline
Log In to Comment