SarahG13 Member since 2018 1 post
Societe Generale
Posted: 1 year ago
Last activity: 1 year 8 months ago

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?

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

Low-Code App Development User Interface SR Exists
Moderation Team has archived post
Share this page LinkedIn