Question

2
Replies
473
Views
Sarah Godfrey (SarahG13)
Societe Generale

Societe Generale
FR
SarahG13 Member since 2018 1 post
Societe Generale
Posted: November 28, 2018
Last activity: January 11, 2019
Posted: 28 Nov 2018 3:18 EST
Last activity: 11 Jan 2019 14:39 EST
Closed

Drag and drop attachment from application to Windows Explorer

I have a requirement to allow the dragging and dropping of case attachments from our Pega application into Windows Explorer folders. I have attempted the following solution:


1. Add an "ondragstart" event and "draggable=true" to the HTML that displays the attachment


2. Call a JS event that invokes a Pega activity. The activity persists the attachment into the ServiceExport directory


3. Invoke JS event: ev.dataTransfer.setData("DownloadURL", "application/octet-stream:"+fileName+":"+URL);


The outcome of this is a failed attachment download with an error "Failed - Server problem" in my downloads bar. However if the URL referenced in the above event is "...datacontent/image/rteimages" then the drag and drop to windows works fine and I can open the file with no problem.



I also tried another solution which bypasses the save to the ServiceExport folder, by changing this JS event:


ev.dataTransfer.setData("DownloadURL", "image/jpeg:Penguins.jpg:data:image/jpeg;charset=utf-8," + fileStream);


The outcome of this is a "Failed - Blocked" attachment download in my downloads bar.


I have checked the permissions on the server folders / internet settings / browser settings and there is nothing preventing a download. We can download an attachment fine with JS function doAttachmentSingleClick.



Any idea why I get these errors? And why I can drag and drop a URL from "...datacontent/image/rteimages" - but not ServiceExport?

I have a requirement to allow the dragging and dropping of case attachments from our Pega application into Windows Explorer folders. I have attempted the following solution:

1. Add an "ondragstart" event and "draggable=true" to the HTML that displays the attachment

2. Call a JS event that invokes a Pega activity. The activity persists the attachment into the ServiceExport directory

3. Invoke JS event: ev.dataTransfer.setData("DownloadURL", "application/octet-stream:"+fileName+":"+URL);

The outcome of this is a failed attachment download with an error "Failed - Server problem" in my downloads bar. However if the URL referenced in the above event is "...datacontent/image/rteimages" then the drag and drop to windows works fine and I can open the file with no problem.

I also tried another solution which bypasses the save to the ServiceExport folder, by changing this JS event:

ev.dataTransfer.setData("DownloadURL", "image/jpeg:Penguins.jpg:data:image/jpeg;charset=utf-8," + fileStream);

The outcome of this is a "Failed - Blocked" attachment download in my downloads bar.

I have checked the permissions on the server folders / internet settings / browser settings and there is nothing preventing a download. We can download an attachment fine with JS function doAttachmentSingleClick.

Any idea why I get these errors? And why I can drag and drop a URL from "...datacontent/image/rteimages" - but not ServiceExport?

***Moderator Edit-Vidyaranjan: Updated SR details***

Low-Code App Development User Experience Support Case Exists
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.