From SQL Server binary column to HTTP Post

0

I have a SQL Server Table (SQL 2014) with binary column. The data stored there will be sent to a cloud storage and removed from the Table.

Assume I have the Table:

| Filename  | Data    
| ----------------------------    
| Test1.jpg | 0x2791236423....    
| Other.pdf | 0x1629462690....    

I am able to select the data as Base64 encoded strings as described here. Now thought I could use CURL to send the files across, so I would generate a batch of commands, resulting in:

curl -X POST https://some.cloudserver.somewhere/Upload -H 'apikey: someapikey374823' -F filename=Test1.jpg -F data=JVBERi0xLjYNCiWhs...
curl -X POST https://some.cloudserver.somewhere/Upload -H 'apikey: someapikey374823' -F filename=Other.pdf -F data=HilkOlMuR6xr37dqa...

Unfortunately, the generated commands are too long (makes sense). But I don't have files which I could send (like, use -F data=@Test1.jpg).

So any other working and easy attempts are very welcome.

thomasjaworski.com

Posted 2019-06-25T08:13:21.653

Reputation: 191

No answers