Skip to main content
Solved

How download an image in Pipefy?


ivensjoris

Hi, i picked card data with the graphql api, and i have the link for an attachment, and i want to download this image, how i can download this in a code, i need to use the cookie? have another option?

Best answer by Roberto Chavarria

An example of the logic you can use for this can be described in this JS snippet here: 
 

function onStartedDownload(id) {
  console.log(`Started downloading: ${id}`);
}
function onFailed(error) {
  console.log(`Download failed: ${error}`);
}
var downloadUrl = "https://example.org/image.png";
var downloading = browser.downloads.download({
  url : downloadUrl,
  filename : 'my-image-again.png',
  conflictAction : 'uniquify'
});
downloading.then(onStartedDownload, onFailed);

 

View original
Did this topic help you find an answer to your question?

3 replies

katarine-leal
Pipefy Staff

Hey, you can download the url of the attachment from the API - of course, during the time that's settled for this link to expire, which is available for 15 minutes. You can use the code you want, since the url provided by the API will give you the file of the attachment. Besides that, could you please tell me more about the using cookies?


Roberto Chavarria
Pipefy Staff
Forum|alt.badge.img+5

An example of the logic you can use for this can be described in this JS snippet here: 
 

function onStartedDownload(id) {
  console.log(`Started downloading: ${id}`);
}
function onFailed(error) {
  console.log(`Download failed: ${error}`);
}
var downloadUrl = "https://example.org/image.png";
var downloading = browser.downloads.download({
  url : downloadUrl,
  filename : 'my-image-again.png',
  conflictAction : 'uniquify'
});
downloading.then(onStartedDownload, onFailed);

 


Marcos Carvalho
Pipefy Staff
Forum|alt.badge.img+6

Here another one in Python: 

import requests

url ='https://s3.amazonaws.com/sample-login/companies/avatars/000/004/594/original/pipe_logo.png?1579786798'

img_data = requests.get(url).content
with open('pipefy.png', 'wb') as handler:
    handler.write(img_data)

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings