mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-03-05 13:30:32 -05:00
fix: error fetching attachments from blob
This commit is contained in:
@@ -5214,22 +5214,23 @@ jQuery.PrivateBin = (function($) {
|
||||
cipherMessage['attachment'] = attachments.map(attachment => attachment[0]);
|
||||
cipherMessage['attachment_name'] = attachments.map(attachment => attachment[1]);
|
||||
|
||||
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment) => {
|
||||
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment, i) => {
|
||||
// we need to retrieve data from blob if browser already parsed it in memory
|
||||
if (typeof attachment === 'string' && attachment.startsWith('blob:')) {
|
||||
Alert.showStatus(
|
||||
[
|
||||
'Retrieving cloned file \'%s\' from memory...',
|
||||
attachment[1]
|
||||
cipherMessage['attachment_name'][i]
|
||||
],
|
||||
'copy'
|
||||
);
|
||||
try {
|
||||
const blobData = await $.ajax({
|
||||
type: 'GET',
|
||||
url: `${attachment}`,
|
||||
url: attachment,
|
||||
processData: false,
|
||||
timeout: 10000,
|
||||
dataType: 'binary',
|
||||
xhrFields: {
|
||||
withCredentials: false,
|
||||
responseType: 'blob'
|
||||
|
||||
Reference in New Issue
Block a user