Question
Andre Wessels · Dec 5, 2019

How to paste a copied document into a %GlobalBinaryStream from the clipboard.

Good day,

We upload images into the database with this code :

<tr>
<td align="right">FileName</td>
<td><input type=file size=200 name=FileStream></td>
</tr>

s FullFilename = %request.Get("FileName")
s FileName = ##class(%File).GetFilename(FullFilename)
s ItemImage.FileName = FileName

s ItemImage.fileSize = %request.MimeData("FileStream",1).Size
d ItemImage.Image.CopyFrom(%request.MimeData("FileStream",1))

The need is now to be able to copy a document (example as attached in an email) and paste to be saved into the  ItemImage.Image
%GlobalBinaryStream

Has anyone done something like this ?

Thanks

André

10
0 2 203 3

Replies

This is actually nothing related to InterSystems at all.

You can do something like in this article. Just catch the file on the client-side in Browser, and send this file to the server, where you can save it as would do it for any usual file